diff --git a/README.md b/README.md index e5ada5f..aad23be 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# `$ fe` - edit your flake inputs with ease +# `$ flake-edit` - edit your flake inputs with ease [![Built with Nix](https://img.shields.io/static/v1?label=built%20with&message=nix&color=5277C3&logo=nixos&style=flat-square&logoColor=ffffff)](https://builtwithnix.org) [![Crates](https://img.shields.io/crates/v/flake-edit?style=flat-square)](https://crates.io/crates/flake-edit) [![Documentation](https://img.shields.io/badge/flake_edit-documentation-fc0060?style=flat-square)](https://docs.rs/flake-edit) [![Matrix Chat Room](https://img.shields.io/badge/chat-on%20matrix-1d7e64?logo=matrix&style=flat-square)](https://matrix.to/#/#flake-edit:matrix.org) -`$ fe` - **f**lake **e**dit - edit your flake inputs with ease. +`$ flake-edit` - edit your flake inputs with ease. -## `$ fe` - usage +## `$ flake-edit` - usage -`fe` has the following cli interface: +`flake-edit` has the following cli interface: -`$ fe help` +`$ flake-edit help` ``` Edit your flake inputs with ease -Usage: fe [OPTIONS] [FLAKE_REF] +Usage: flake-edit [OPTIONS] [FLAKE_REF] Commands: add @@ -47,12 +47,12 @@ Options: Print version ``` -### `$ fe add` -`$ fe help add` +### `$ flake-edit add` +`$ flake-edit help add` ``` Add a new flake reference -Usage: fe add [OPTIONS] [ID] [URI] +Usage: flake-edit add [OPTIONS] [ID] [URI] Arguments: [ID] @@ -69,17 +69,17 @@ Options: Print help ``` For some types, the id will be automatically inferred. -![fe add example](assets/tape/output/add_input.gif) +![flake-edit add example](assets/tape/output/add_input.gif) For some inputs, the uri can be put in directly and the id and type will be inferred. -![fe add inferred example](assets/tape/output/add_input_inferred.gif) +![flake-edit add inferred example](assets/tape/output/add_input_inferred.gif) -### `$ fe remove` -`$ fe help remove` +### `$ flake-edit remove` +`$ flake-edit help remove` ``` Remove a specific flake reference based on its id -Usage: fe remove [ID] +Usage: flake-edit remove [ID] Arguments: [ID] @@ -89,14 +89,14 @@ Options: -h, --help Print help ``` -![fe remove example](assets/tape/output/remove_input.gif) +![flake-edit remove example](assets/tape/output/remove_input.gif) -### `$ fe list` -`$ fe help list` +### `$ flake-edit list` +`$ flake-edit help list` ``` List flake inputs -Usage: fe list [OPTIONS] +Usage: flake-edit list [OPTIONS] Options: --format @@ -105,9 +105,9 @@ Options: Print help ``` List the outputs, that are specified inside the inputs attribute. -![fe list example](assets/tape/output/list_inputs.gif) +![flake-edit list example](assets/tape/output/list_inputs.gif) List the outputs, that are specified inside the inputs attribute, in json format. -![fe list example](assets/tape/output/list_inputs_json.gif) +![flake-edit list example](assets/tape/output/list_inputs_json.gif) ## License diff --git a/assets/completions/fish/completions.fish b/assets/completions/fish/completions.fish index 86b669a..5ccb2b9 100644 --- a/assets/completions/fish/completions.fish +++ b/assets/completions/fish/completions.fish @@ -1,19 +1,19 @@ function __fish_complete_inputs - fe list --format simple 2>/dev/null + flake-edit list --format simple 2>/dev/null end function __fish_complete_add - fe completion add 2>/dev/null + flake-edit completion add 2>/dev/null end -complete -c fe -n "__fish_seen_subcommand_from rm" -f -a "(__fish_complete_inputs)" -d Input -complete -c fe -n "__fish_seen_subcommand_from remove" -f -a "(__fish_complete_inputs)" -d Input -complete -c fe -n "__fish_seen_subcommand_from change" -f -a "(__fish_complete_inputs)" -d Input -complete -c fe -n "__fish_seen_subcommand_from c" -f -a "(__fish_complete_inputs)" -d Input -complete -c fe -n "__fish_seen_subcommand_from pin" -f -a "(__fish_complete_inputs)" -d Input -complete -c fe -n "__fish_seen_subcommand_from p" -f -a "(__fish_complete_inputs)" -d Input +complete -c flake-edit -n "__fish_seen_subcommand_from rm" -f -a "(__fish_complete_inputs)" -d Input +complete -c flake-edit -n "__fish_seen_subcommand_from remove" -f -a "(__fish_complete_inputs)" -d Input +complete -c flake-edit -n "__fish_seen_subcommand_from change" -f -a "(__fish_complete_inputs)" -d Input +complete -c flake-edit -n "__fish_seen_subcommand_from c" -f -a "(__fish_complete_inputs)" -d Input +complete -c flake-edit -n "__fish_seen_subcommand_from pin" -f -a "(__fish_complete_inputs)" -d Input +complete -c flake-edit -n "__fish_seen_subcommand_from p" -f -a "(__fish_complete_inputs)" -d Input set -x ignore_space true -complete -c fe -n "__fish_seen_subcommand_from a" -f -r --keep-order -a "(__fish_complete_add)" -d Add -complete -c fe -n "__fish_seen_subcommand_from add" -f -r --keep-order -a "(__fish_complete_add)" -d Add +complete -c flake-edit -n "__fish_seen_subcommand_from a" -f -r --keep-order -a "(__fish_complete_add)" -d Add +complete -c flake-edit -n "__fish_seen_subcommand_from add" -f -r --keep-order -a "(__fish_complete_add)" -d Add set -x ignore_space false diff --git a/assets/tape/list_inputs.tape b/assets/tape/list_inputs.tape index bccece2..b49c4a0 100644 --- a/assets/tape/list_inputs.tape +++ b/assets/tape/list_inputs.tape @@ -67,5 +67,5 @@ Type "set -x fish_function_path ''" Enter Type "clear" Enter Show -Type "fe list --format detailed" Sleep 1000ms Enter +Type "flake-edit list --format detailed" Sleep 1000ms Enter Sleep 5s diff --git a/assets/tape/list_inputs_json.tape b/assets/tape/list_inputs_json.tape index e0c31b4..baf180e 100644 --- a/assets/tape/list_inputs_json.tape +++ b/assets/tape/list_inputs_json.tape @@ -67,5 +67,5 @@ Type "set -x fish_function_path ''" Enter Type "clear" Enter Show -Type "fe list --format json | jq .crane" Sleep 1000ms Enter +Type "flake-edit list --format json | jq .crane" Sleep 1000ms Enter Sleep 5s diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md index 8b6bcd6..d50c113 100644 --- a/doc/CONTRIBUTING.md +++ b/doc/CONTRIBUTING.md @@ -5,10 +5,10 @@ Please raise an issue, to see if a potential feature is in scope of the project. We are always happy to receive contributions and attempt to process them in a timely manner. ## Issues -To get an overview of what can be worked on, please take a look at the [issues](https://github.com/a-kenji/fe/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). +To get an overview of what can be worked on, please take a look at the [issues](https://github.com/a-kenji/flake-edit/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). ## How to get tools -For your convenience you only need one tool to contribute to `fe` or `flake-edit`: `nix`. +For your convenience you only need one tool to contribute to `flake-edit` or `flake-edit`: `nix`. You can drop into a development shell with: ``` nix develop diff --git a/nix/apps.nix b/nix/apps.nix index 8c17e4f..80e7837 100644 --- a/nix/apps.nix +++ b/nix/apps.nix @@ -4,7 +4,7 @@ _: { { apps = { default = self'.packages.default; - fe = self'.packages.fe; + flake-edit = self'.packages.flake-edit; }; }; } diff --git a/nix/checks.nix b/nix/checks.nix index 184269a..a5a069f 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -4,7 +4,7 @@ _: { { checks = { inherit (self'.packages) - fe + flake-edit cargoArtifacts cargoClippy # cargoDeny diff --git a/nix/fe.nix b/nix/flake-edit.nix similarity index 94% rename from nix/fe.nix rename to nix/flake-edit.nix index 576d603..9bbc6c0 100644 --- a/nix/fe.nix +++ b/nix/flake-edit.nix @@ -47,7 +47,7 @@ let ''; in { - fe = craneLib.buildPackage ( + flake-edit = craneLib.buildPackage ( commonArgs // { cargoExtraArgs = "-p ${name}"; @@ -59,9 +59,9 @@ in }; doCheck = false; version = "unstable-" + gitDate; - pname = "fe"; - name = "fe"; - postInstall = postInstall "fe"; + pname = "flake-edit"; + name = "flake-edit"; + postInstall = postInstall "flake-edit"; inherit assetDir cargoArtifacts meta; } ); diff --git a/nix/meta.nix b/nix/meta.nix index e559cbf..b147e1a 100644 --- a/nix/meta.nix +++ b/nix/meta.nix @@ -1,6 +1,6 @@ { lib, ... }: { - homepage = "https://github.com/a-kenji/fe"; - mainProgram = "fe"; + homepage = "https://github.com/a-kenji/flake-edit"; + mainProgram = "flake-edit"; license = [ lib.licenses.mit ]; } diff --git a/nix/packages.nix b/nix/packages.nix index cbb71b6..c3a2d86 100644 --- a/nix/packages.nix +++ b/nix/packages.nix @@ -4,9 +4,9 @@ { pkgs, ... }: { packages = rec { - default = fe; - inherit ((pkgs.callPackage ./fe.nix { inherit self; })) - fe + default = flake-edit; + inherit ((pkgs.callPackage ./flake-edit.nix { inherit self; })) + flake-edit cargoArtifacts cargoClippy cargoDeny diff --git a/src/bin/flake-edit/cache.rs b/src/bin/flake-edit/cache.rs index 01d0578..d3b9b1b 100644 --- a/src/bin/flake-edit/cache.rs +++ b/src/bin/flake-edit/cache.rs @@ -5,12 +5,12 @@ use std::sync::OnceLock; use directories::ProjectDirs; use serde::{Deserialize, Serialize}; -static CACHE_FILE_NAME: &str = "fe.json"; +static CACHE_FILE_NAME: &str = "flake_edit.json"; fn cache_dir() -> &'static PathBuf { static CACHE_DIR: OnceLock = OnceLock::new(); CACHE_DIR.get_or_init(|| { - let project_dir = ProjectDirs::from("com", "a-kenji", "fe").unwrap(); + let project_dir = ProjectDirs::from("com", "a-kenji", "flake-edit").unwrap(); return project_dir.data_dir().to_path_buf(); }) } diff --git a/src/bin/flake-edit/cli.rs b/src/bin/flake-edit/cli.rs index 7bb046c..ae8b568 100644 --- a/src/bin/flake-edit/cli.rs +++ b/src/bin/flake-edit/cli.rs @@ -4,7 +4,7 @@ use clap::{Parser, Subcommand}; #[derive(Parser, Debug)] #[command(author, version = CliArgs::unstable_version(), about, long_about = None)] -#[command(name = "fe")] +#[command(name = "flake-edit")] #[command(next_line_help = true)] /// Edit your flake inputs with ease pub struct CliArgs { diff --git a/src/bin/flake-edit/error.rs b/src/bin/flake-edit/error.rs index 6434981..744aae3 100644 --- a/src/bin/flake-edit/error.rs +++ b/src/bin/flake-edit/error.rs @@ -2,7 +2,7 @@ use thiserror::Error; #[derive(Debug, Error)] pub enum FeError { - /// Generic fe error. + /// Generic flake-edit error. #[allow(unused)] #[error("Error: {0}")] Error(String), diff --git a/src/bin/flake-edit/log.rs b/src/bin/flake-edit/log.rs index 415e23e..c285d55 100644 --- a/src/bin/flake-edit/log.rs +++ b/src/bin/flake-edit/log.rs @@ -40,5 +40,5 @@ pub fn init_logging(log_file: Option) -> Result<(), std::io::Error> { } pub fn init() -> Result<(), std::io::Error> { - init_logging(Some("/tmp/fe/fe.log".into())) + init_logging(Some("/tmp/flake-edit/flake-edit.log".into())) } diff --git a/src/bin/flake-edit/main.rs b/src/bin/flake-edit/main.rs index 0d0f425..8a02bef 100644 --- a/src/bin/flake-edit/main.rs +++ b/src/bin/flake-edit/main.rs @@ -80,7 +80,7 @@ fn main() -> eyre::Result<()> { eyre::eyre!("Could not infer [ID] from flake reference.") .with_note(|| format!("The provided uri: {uri}")) .suggestion( - "\nPlease specify an [ID] for this flake reference.\nIn the following form: `fe add [ID] [uri]`\nIf you think the [ID] should have been able to be inferred, please open an issue.", + "\nPlease specify an [ID] for this flake reference.\nIn the following form: `flake-edit add [ID] [uri]`\nIf you think the [ID] should have been able to be inferred, please open an issue.", ), ); } @@ -161,7 +161,7 @@ fn main() -> eyre::Result<()> { "The input with id: {} could not be removed.", change.id().unwrap() ) - .suggestion("\nPlease check if an input with that [ID] exists in the flake.nix file.\nRun `fe list --format simple` to see the current inputs by their id.")); + .suggestion("\nPlease check if an input with that [ID] exists in the flake.nix file.\nRun `flake-edit list --format simple` to see the current inputs by their id.")); } println!("Nothing changed in the node."); println!("The following change could not be applied: \n{:?}", change);