Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm: unimplemented harness #70

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
`flake-edit` has the following cli interface:

`$ flake-edit help`

```
Edit your flake inputs with ease

Expand All @@ -19,14 +20,14 @@ Usage: flake-edit [OPTIONS] [FLAKE_REF] <COMMAND>
Commands:
add
Add a new flake reference
pin
Pin a specific flake reference based on its id
change
Change a specific flake reference based on its id

remove
Remove a specific flake reference based on its id
list
List flake inputs
update
Update inputs to their latest specified release
help
Print this message or the help of the given subcommand(s)

Expand All @@ -37,10 +38,10 @@ Arguments:
Options:
--flake <FLAKE>

--health
Checks for potential errors in the setup
--ref-or-rev <REF_OR_REV>
Pin to a specific ref_or_rev
--diff
Print a diff of the changes, will set the apply flag to false
--apply
Whether to apply possible changes
-h, --help
Print help
-V, --version
Expand All @@ -49,6 +50,7 @@ Options:

### `$ flake-edit add`
`$ flake-edit help add`

```
Add a new flake reference

Expand All @@ -62,9 +64,9 @@ Arguments:

Options:
--ref-or-rev <REF_OR_REV>

--force <FORCE>
Allow operations on uncommitted files
Pin to a specific ref_or_rev
-n, --no-flake
The input itself is not a flake
-h, --help
Print help
```
Expand All @@ -77,6 +79,7 @@ For some inputs, the uri can be put in directly and the id and type will be infe

### `$ flake-edit remove`
`$ flake-edit help remove`

```
Remove a specific flake reference based on its id

Expand All @@ -94,6 +97,7 @@ Options:

### `$ flake-edit list`
`$ flake-edit help list`

```
List flake inputs

Expand Down
15 changes: 2 additions & 13 deletions src/bin/flake-edit/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ pub struct CliArgs {
// The flake ref, or id that should be passed through to the nix command
// By default will choose the local flake.
flake_ref: Option<String>,
/// Checks for potential errors in the setup
#[arg(long)]
health: bool,
/// Pin to a specific ref_or_rev
#[arg(long)]
ref_or_rev: Option<String>,
/// Print a diff of the changes, will set the apply flag to false.
#[arg(long, default_value_t = false)]
diff: bool,
Expand Down Expand Up @@ -81,18 +75,13 @@ pub(crate) enum Command {
// #[arg(last = true)]
uri: Option<String>,
#[arg(long)]
/// Pin to a specific ref_or_rev
ref_or_rev: Option<String>,
/// Allow operations on uncommitted files.
#[arg(long)]
force: Option<String>,
/// The input itself is not a flake.
#[arg(long, short)]
no_flake: bool,
},
/// Pin a specific flake reference based on its id.
#[command(alias = "p", arg_required_else_help = true)]
Pin { id: Option<String> },
/// Change a specific flake reference based on its id.
// /// Change a specific flake reference based on its id.
#[command(alias = "c", arg_required_else_help = true)]
Change {
id: Option<String>,
Expand Down
2 changes: 0 additions & 2 deletions src/bin/flake-edit/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ fn main() -> eyre::Result<()> {
uri,
ref_or_rev: _,
id,
force: _,
no_flake,
} => {
if id.is_some() && uri.is_some() {
Expand Down Expand Up @@ -86,7 +85,6 @@ fn main() -> eyre::Result<()> {
}
}
}
cli::Command::Pin { .. } => todo!(),
cli::Command::Remove { id } => {
if let Some(id) = id {
change = Change::Remove {
Expand Down
Loading