diff --git a/docs/cli/add.md b/docs/cli/add.md index 213986d..2fccf98 100644 --- a/docs/cli/add.md +++ b/docs/cli/add.md @@ -1,3 +1,6 @@ # `pitchfork add` - **Usage**: `pitchfork add` +- **Aliases**: `a` + +Add a new daemon to pitchfork.toml diff --git a/docs/cli/clean.md b/docs/cli/clean.md index 4b62108..e9bd46c 100644 --- a/docs/cli/clean.md +++ b/docs/cli/clean.md @@ -1,3 +1,6 @@ # `pitchfork clean` - **Usage**: `pitchfork clean` +- **Aliases**: `c` + +Removes stopped/failed daemons from `pitchfork list` diff --git a/docs/cli/commands.json b/docs/cli/commands.json index 2077dc1..eed7de0 100644 --- a/docs/cli/commands.json +++ b/docs/cli/commands.json @@ -15,8 +15,11 @@ "flags": [], "mounts": [], "hide": false, + "help": "Add a new daemon to pitchfork.toml", "name": "add", - "aliases": [], + "aliases": [ + "a" + ], "hidden_aliases": [], "examples": [] }, @@ -30,8 +33,11 @@ "flags": [], "mounts": [], "hide": false, + "help": "Removes stopped/failed daemons from `pitchfork list`", "name": "clean", - "aliases": [], + "aliases": [ + "c" + ], "hidden_aliases": [], "examples": [] }, @@ -69,8 +75,11 @@ "flags": [], "mounts": [], "hide": false, + "help": "Prevent a daemon from restarting", "name": "disable", - "aliases": [], + "aliases": [ + "d" + ], "hidden_aliases": [], "examples": [] }, @@ -84,8 +93,11 @@ "flags": [], "mounts": [], "hide": false, + "help": "Allow a daemon to start", "name": "enable", - "aliases": [], + "aliases": [ + "e" + ], "hidden_aliases": [], "examples": [] }, @@ -99,8 +111,11 @@ "flags": [], "mounts": [], "hide": false, + "help": "List all daemons", "name": "list", - "aliases": [], + "aliases": [ + "ls" + ], "hidden_aliases": [], "examples": [] }, @@ -160,7 +175,9 @@ "hide": false, "help": "Displays logs for daemon(s)", "name": "logs", - "aliases": [], + "aliases": [ + "l" + ], "hidden_aliases": [], "examples": [] }, @@ -174,8 +191,11 @@ "flags": [], "mounts": [], "hide": false, + "help": "Remove a daemon from pitchfork.toml", "name": "remove", - "aliases": [], + "aliases": [ + "rm" + ], "hidden_aliases": [], "examples": [] }, @@ -220,7 +240,9 @@ "hide": false, "help": "Runs a one-off daemon", "name": "run", - "aliases": [], + "aliases": [ + "r" + ], "hidden_aliases": [], "examples": [] }, @@ -246,7 +268,9 @@ "hide": false, "help": "Starts a daemon from a pitchfork.toml file", "name": "start", - "aliases": [], + "aliases": [ + "s" + ], "hidden_aliases": [], "examples": [] }, @@ -260,8 +284,11 @@ "flags": [], "mounts": [], "hide": false, + "help": "Display the status of a daemons", "name": "status", - "aliases": [], + "aliases": [ + "stat" + ], "hidden_aliases": [], "examples": [] }, @@ -275,8 +302,11 @@ "flags": [], "mounts": [], "hide": false, + "help": "Kill a running daemon", "name": "stop", - "aliases": [], + "aliases": [ + "kill" + ], "hidden_aliases": [], "examples": [] }, @@ -404,7 +434,7 @@ "args": [], "flags": [], "mounts": [], - "hide": false, + "hide": true, "help": "Generates a usage spec for the CLI", "help_long": "Generates a usage spec for the CLI\n\nhttps://usage.jdx.dev", "name": "usage", @@ -422,8 +452,12 @@ "flags": [], "mounts": [], "hide": false, + "help": "Wait for a daemon to stop, tailing the logs along the way", + "help_long": "Wait for a daemon to stop, tailing the logs along the way\n\nExits with the same status code as the daemon", "name": "wait", - "aliases": [], + "aliases": [ + "w" + ], "hidden_aliases": [], "examples": [] } diff --git a/docs/cli/disable.md b/docs/cli/disable.md index 64d0838..6982f81 100644 --- a/docs/cli/disable.md +++ b/docs/cli/disable.md @@ -1,3 +1,6 @@ # `pitchfork disable` - **Usage**: `pitchfork disable` +- **Aliases**: `d` + +Prevent a daemon from restarting diff --git a/docs/cli/enable.md b/docs/cli/enable.md index 3119189..b9faa1f 100644 --- a/docs/cli/enable.md +++ b/docs/cli/enable.md @@ -1,3 +1,6 @@ # `pitchfork enable` - **Usage**: `pitchfork enable` +- **Aliases**: `e` + +Allow a daemon to start diff --git a/docs/cli/index.md b/docs/cli/index.md index 900c0cb..1f01313 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -23,5 +23,4 @@ - [`pitchfork supervisor start [-f --force]`](/cli/supervisor/start.md) - [`pitchfork supervisor status`](/cli/supervisor/status.md) - [`pitchfork supervisor stop`](/cli/supervisor/stop.md) -- [`pitchfork usage`](/cli/usage.md) - [`pitchfork wait`](/cli/wait.md) diff --git a/docs/cli/list.md b/docs/cli/list.md index b2d7d1b..35b0d93 100644 --- a/docs/cli/list.md +++ b/docs/cli/list.md @@ -1,3 +1,6 @@ # `pitchfork list` - **Usage**: `pitchfork list` +- **Aliases**: `ls` + +List all daemons diff --git a/docs/cli/logs.md b/docs/cli/logs.md index e74f84f..0aa8c72 100644 --- a/docs/cli/logs.md +++ b/docs/cli/logs.md @@ -1,6 +1,7 @@ # `pitchfork logs` - **Usage**: `pitchfork logs [-n ] [-t --tail] [NAME]...` +- **Aliases**: `l` Displays logs for daemon(s) diff --git a/docs/cli/remove.md b/docs/cli/remove.md index 183ccdf..eedd223 100644 --- a/docs/cli/remove.md +++ b/docs/cli/remove.md @@ -1,3 +1,6 @@ # `pitchfork remove` - **Usage**: `pitchfork remove` +- **Aliases**: `rm` + +Remove a daemon from pitchfork.toml diff --git a/docs/cli/run.md b/docs/cli/run.md index 5e7a148..493cc2d 100644 --- a/docs/cli/run.md +++ b/docs/cli/run.md @@ -1,6 +1,7 @@ # `pitchfork run` - **Usage**: `pitchfork run [-f --force] [CMD]...` +- **Aliases**: `r` Runs a one-off daemon diff --git a/docs/cli/start.md b/docs/cli/start.md index 116917d..352d370 100644 --- a/docs/cli/start.md +++ b/docs/cli/start.md @@ -1,6 +1,7 @@ # `pitchfork start` - **Usage**: `pitchfork start [NAME]...` +- **Aliases**: `s` Starts a daemon from a pitchfork.toml file diff --git a/docs/cli/status.md b/docs/cli/status.md index b2d0fb7..5f76c95 100644 --- a/docs/cli/status.md +++ b/docs/cli/status.md @@ -1,3 +1,6 @@ # `pitchfork status` - **Usage**: `pitchfork status` +- **Aliases**: `stat` + +Display the status of a daemons diff --git a/docs/cli/stop.md b/docs/cli/stop.md index 651b038..2c142df 100644 --- a/docs/cli/stop.md +++ b/docs/cli/stop.md @@ -1,3 +1,6 @@ # `pitchfork stop` - **Usage**: `pitchfork stop` +- **Aliases**: `kill` + +Kill a running daemon diff --git a/docs/cli/usage.md b/docs/cli/usage.md deleted file mode 100644 index f38fa61..0000000 --- a/docs/cli/usage.md +++ /dev/null @@ -1,7 +0,0 @@ -# `pitchfork usage` - -- **Usage**: `pitchfork usage` - -Generates a usage spec for the CLI - -https://usage.jdx.dev diff --git a/docs/cli/wait.md b/docs/cli/wait.md index f9ec4a9..86d36d7 100644 --- a/docs/cli/wait.md +++ b/docs/cli/wait.md @@ -1,3 +1,8 @@ # `pitchfork wait` - **Usage**: `pitchfork wait` +- **Aliases**: `w` + +Wait for a daemon to stop, tailing the logs along the way + +Exits with the same status code as the daemon diff --git a/pitchfork.usage.kdl b/pitchfork.usage.kdl index 2c2995c..30aa39f 100644 --- a/pitchfork.usage.kdl +++ b/pitchfork.usage.kdl @@ -1,15 +1,26 @@ name "pitchfork-cli" bin "pitchfork" usage "Usage: pitchfork-cli " -cmd "add" -cmd "clean" +cmd "add" help="Add a new daemon to pitchfork.toml" { + alias "a" +} +cmd "clean" help="Removes stopped/failed daemons from `pitchfork list`" { + alias "c" +} cmd "completion" { arg "" help="The shell to generate completion for" } -cmd "disable" -cmd "enable" -cmd "list" +cmd "disable" help="Prevent a daemon from restarting" { + alias "d" +} +cmd "enable" help="Allow a daemon to start" { + alias "e" +} +cmd "list" help="List all daemons" { + alias "ls" +} cmd "logs" help="Displays logs for daemon(s)" { + alias "l" flag "-n" help="Show N lines of logs" { long_help "Show N lines of logs\n\nSet to 0 to show all logs" arg "" @@ -17,17 +28,25 @@ cmd "logs" help="Displays logs for daemon(s)" { flag "-t --tail" help="Show logs in real-time" arg "[NAME]..." help="Show only logs for the specified daemon(s)" var=true } -cmd "remove" +cmd "remove" help="Remove a daemon from pitchfork.toml" { + alias "rm" +} cmd "run" help="Runs a one-off daemon" { + alias "r" flag "-f --force" arg "" help="Name of the daemon to run" arg "[CMD]..." var=true } cmd "start" help="Starts a daemon from a pitchfork.toml file" { + alias "s" arg "[NAME]..." help="Name of the daemon(s) in pitchfork.toml to start" var=true } -cmd "status" -cmd "stop" +cmd "status" help="Display the status of a daemons" { + alias "stat" +} +cmd "stop" help="Kill a running daemon" { + alias "kill" +} cmd "supervisor" subcommand_required=true { cmd "run" help="Runs the internal pitchfork daemon in the foreground" { flag "-f --force" help="kill existing daemon" @@ -38,10 +57,15 @@ cmd "supervisor" subcommand_required=true { cmd "status" help="Gets the status of the pitchfork daemon" cmd "stop" help="Stops the internal pitchfork daemon running in the background" } -cmd "usage" help="Generates a usage spec for the CLI" { +cmd "usage" hide=true help="Generates a usage spec for the CLI" { long_help r"Generates a usage spec for the CLI https://usage.jdx.dev" } -cmd "wait" +cmd "wait" help="Wait for a daemon to stop, tailing the logs along the way" { + alias "w" + long_help r"Wait for a daemon to stop, tailing the logs along the way + +Exits with the same status code as the daemon" +} diff --git a/src/cli/add.rs b/src/cli/add.rs index f5874be..8f055f0 100644 --- a/src/cli/add.rs +++ b/src/cli/add.rs @@ -1,7 +1,8 @@ use crate::Result; +/// Add a new daemon to pitchfork.toml #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "a", verbatim_doc_comment)] pub struct Add {} impl Add { diff --git a/src/cli/clean.rs b/src/cli/clean.rs index 79601c7..0513c50 100644 --- a/src/cli/clean.rs +++ b/src/cli/clean.rs @@ -1,7 +1,8 @@ use crate::Result; +/// Removes stopped/failed daemons from `pitchfork list` #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "c", verbatim_doc_comment)] pub struct Clean {} impl Clean { diff --git a/src/cli/completion.rs b/src/cli/completion.rs index cdce925..92274b6 100644 --- a/src/cli/completion.rs +++ b/src/cli/completion.rs @@ -19,7 +19,7 @@ impl Completion { &self.shell, "pitchfork", "--usage-cmd", - "pitchfork --usage", + "pitchfork usage", ) .run() .into_diagnostic()?; diff --git a/src/cli/disable.rs b/src/cli/disable.rs index dd4d4fc..da5d867 100644 --- a/src/cli/disable.rs +++ b/src/cli/disable.rs @@ -1,7 +1,8 @@ use crate::Result; +/// Prevent a daemon from restarting #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "d", verbatim_doc_comment)] pub struct Disable {} impl Disable { diff --git a/src/cli/enable.rs b/src/cli/enable.rs index 06de767..eb33025 100644 --- a/src/cli/enable.rs +++ b/src/cli/enable.rs @@ -1,7 +1,8 @@ use crate::Result; +/// Allow a daemon to start #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "e", verbatim_doc_comment)] pub struct Enable {} impl Enable { diff --git a/src/cli/list.rs b/src/cli/list.rs index b990f38..cf6ba9d 100644 --- a/src/cli/list.rs +++ b/src/cli/list.rs @@ -1,7 +1,8 @@ use crate::Result; +/// List all daemons #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "ls", verbatim_doc_comment)] pub struct List {} impl List { diff --git a/src/cli/logs.rs b/src/cli/logs.rs index 8505899..0cc41fd 100644 --- a/src/cli/logs.rs +++ b/src/cli/logs.rs @@ -12,7 +12,7 @@ use xx::regex; /// Displays logs for daemon(s) #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "l", verbatim_doc_comment)] pub struct Logs { /// Show only logs for the specified daemon(s) name: Vec, diff --git a/src/cli/remove.rs b/src/cli/remove.rs index 3fdcf35..18d8078 100644 --- a/src/cli/remove.rs +++ b/src/cli/remove.rs @@ -1,7 +1,8 @@ use crate::Result; +/// Remove a daemon from pitchfork.toml #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "rm", verbatim_doc_comment)] pub struct Remove {} impl Remove { diff --git a/src/cli/run.rs b/src/cli/run.rs index bf6c855..d18fe52 100644 --- a/src/cli/run.rs +++ b/src/cli/run.rs @@ -5,7 +5,7 @@ use miette::bail; /// Runs a one-off daemon #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "r", verbatim_doc_comment)] pub struct Run { /// Name of the daemon to run name: String, diff --git a/src/cli/start.rs b/src/cli/start.rs index a653312..e6fcce0 100644 --- a/src/cli/start.rs +++ b/src/cli/start.rs @@ -3,7 +3,7 @@ use crate::Result; /// Starts a daemon from a pitchfork.toml file #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "s", verbatim_doc_comment)] pub struct Start { /// Name of the daemon(s) in pitchfork.toml to start name: Vec, diff --git a/src/cli/status.rs b/src/cli/status.rs index 7c0a0bc..cb525e4 100644 --- a/src/cli/status.rs +++ b/src/cli/status.rs @@ -1,7 +1,8 @@ use crate::Result; +/// Display the status of a daemons #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "stat", verbatim_doc_comment)] pub struct Status {} impl Status { diff --git a/src/cli/stop.rs b/src/cli/stop.rs index d272e09..64eea58 100644 --- a/src/cli/stop.rs +++ b/src/cli/stop.rs @@ -1,7 +1,8 @@ use crate::Result; +/// Kill a running daemon #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "kill", verbatim_doc_comment)] pub struct Stop {} impl Stop { diff --git a/src/cli/usage.rs b/src/cli/usage.rs index 3463058..6948257 100644 --- a/src/cli/usage.rs +++ b/src/cli/usage.rs @@ -6,7 +6,7 @@ use clap::CommandFactory; /// /// https://usage.jdx.dev #[derive(Debug, clap::Args)] -#[clap(verbatim_doc_comment)] +#[clap(hide = true, verbatim_doc_comment)] pub struct Usage {} impl Usage { diff --git a/src/cli/wait.rs b/src/cli/wait.rs index d2c9923..ab66912 100644 --- a/src/cli/wait.rs +++ b/src/cli/wait.rs @@ -1,7 +1,10 @@ use crate::Result; +/// Wait for a daemon to stop, tailing the logs along the way +/// +/// Exits with the same status code as the daemon #[derive(Debug, clap::Args)] -#[clap()] +#[clap(visible_alias = "w", verbatim_doc_comment)] pub struct Wait {} impl Wait {