Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
ops: banish underscores in cli commands
Browse files Browse the repository at this point in the history
Either we do `-` or `_`, and we already use `-` for all flags and
`self-upgrade`. Consistency is king for good UX.
  • Loading branch information
Profpatsch committed Apr 16, 2020
1 parent 199eb1e commit 200f4a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
changelog = {
# Find the current version number with `git log --pretty=%h | wc -l`
entries = [
{
version = 534;
changes = ''
Rename `lorri internal` commands for consistency:
- `start_user_shell` -> `start-user-shell`
- `stream_events` -> `stream-events`
'';
}
{
version = 518;
changes = ''
Expand Down
6 changes: 3 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub struct ShellOptions {
pub cached: bool,
}

/// Options for the `internal start_user_shell` subcommand.
/// Options for the `internal start-user-shell` subcommand.
#[derive(StructOpt, Debug)]
pub struct StartUserShellOptions_ {
/// The path of the parent shell's binary
Expand All @@ -122,15 +122,15 @@ pub struct WatchOptions {
#[derive(StructOpt, Debug)]
pub enum Internal_ {
/// (internal) Used internally by `lorri shell`
#[structopt(name = "start_user_shell")]
#[structopt(name = "start-user-shell")]
StartUserShell_(StartUserShellOptions_),

/// (plumbing) Tell the lorri daemon to care about the current directory's project
#[structopt(name = "ping")]
Ping_(Ping_),

/// (plumbing) Ask the lorri daemon to report build events as they occur
#[structopt(name = "stream_events")]
#[structopt(name = "stream-events")]
StreamEvents_(StreamEvents_),
}

Expand Down
4 changes: 2 additions & 2 deletions src/ops/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use std::{env, thread};
/// ├── builds the project environment if --cached is false
/// ├── writes a bash init script that loads the project environment
/// ├── SPAWNS bash with the init script as its `--rcfile`
/// │ └── EXECS `lorri internal start_user_shell`
/// │ └── EXECS `lorri internal start-user-shell`
/// │ ├── (*) performs shell-specific setup for $SHELL
/// │ └── EXECS into user shell $SHELL
/// │ └── interactive user shell
Expand All @@ -55,7 +55,7 @@ pub fn main(project: Project, opts: ShellOptions) -> OpResult {
let status = bash_cmd
.args(&[
"-c",
"exec \"$1\" internal start_user_shell --shell-path=\"$2\" --shell-file=\"$3\"",
"exec \"$1\" internal start-user-shell --shell-path=\"$2\" --shell-file=\"$3\"",
"--",
&lorri
.to_str()
Expand Down

0 comments on commit 200f4a2

Please sign in to comment.