runix/arguments/
source.rs

1//! Source installable related arguments, see [SourceArgs]
2
3use derive_more::{Deref, From};
4use runix_derive::ToArgs;
5
6use crate::command_line::ToArgs;
7use crate::default::flag::{Flag, FlagType};
8
9/// Source installable related arguments
10/// Corresponding to the arguments defined in
11/// [libcmd/installables.cc](https://github.com/NixOS/nix/blob/a6239eb5700ebb85b47bb5f12366404448361f8d/src/libcmd/installables.cc#L146-L186)
12#[derive(Clone, Default, Debug, ToArgs)]
13pub struct SourceArgs {
14    pub expr: Option<Expr>,
15}
16
17#[derive(Clone, From, Deref, Debug, Default)]
18#[from(forward)]
19pub struct Expr(String);
20impl Flag for Expr {
21    const FLAG: &'static str = "--expr";
22    const FLAG_TYPE: FlagType<Self> = FlagType::arg();
23}