Skip to content

Commit d2d9171

Browse files
authored
Update docs
1 parent ddf13ec commit d2d9171

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,27 @@ All communication between the `sudo` server and client is done via Unix socket.
2727

2828
![How it works](images/how-it-works.svg)
2929

30+
## Usage
31+
```text
32+
sudo <command to execute or sudo options>
33+
---
34+
crew-sudo [command] <options>
35+
crew-sudo -h|--help
36+
crew-sudo -V|--version
37+
```
38+
39+
|Command |Description|
40+
|:-------------|:----------|
41+
|`client` |Run as client mode, pass all given command arguments to daemon|
42+
|`daemon` |Run as daemon mode, listen incoming requests at /tmp/crew-sudo.socket|
43+
|`stop-daemon` |Stop currently running crew-sudo daemon|
44+
45+
|Options |Description|
46+
|:-------------|:----------|
47+
|`--bashrc` |Suppress "daemon is already running" error|
48+
|`--foreground`|Run crew-sudo daemon in foreground|
49+
|`--replace` |Replace the currently running crew-sudo daemon|
50+
3051
## What works currently
3152
- Send terminal input to command/send command output back to `crosh`
3253
- Handle terminal size events

component/daemon.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def runas_daemon(argv)
1818
message <<~EOT, loglevel: :error
1919
crew-sudo daemon (process #{File.read(PID_FILE_PATH)}) is already running.
2020
21-
Use `#{PROGNAME} --daemon --replace` to replace the running daemon.
21+
Use `#{PROGNAME} daemon --replace` to replace the running daemon.
2222
EOT
2323
end
2424
exit 1

crew-sudo

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,20 @@ when 'crew-sudo'
2626
warn <<~EOT
2727
#{File.basename($0)} multi-purpose launcher
2828
29-
Usage: #{PROGNAME} [mode]
29+
Usage: #{PROGNAME} [command] <options>
3030
#{PROGNAME} -h|--help
3131
#{PROGNAME} -V|--version
3232
3333
Available commands:
34-
daemon Run as daemon mode, listen incoming requests at #{SOCKET_PATH}
3534
client Run as client mode, pass all given command arguments to daemon
35+
daemon Run as daemon mode, listen incoming requests at #{SOCKET_PATH}
3636
stop-daemon Stop currently running crew-sudo daemon
3737
38+
Available options:
39+
--bashrc Suppress "daemon is already running" error
40+
--foreground Run crew-sudo daemon in foreground
41+
--replace Replace the currently running crew-sudo daemon
42+
3843
EOT
3944
when '-V', '--version'
4045
warn "#{PROGNAME} version 1.0"

0 commit comments

Comments
 (0)