WIP: fix the command line interface #39
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The main idea is to improve the command line interface by adding new subcommands with much clearer semantics.
For example:
bkctld add-ip <JAIL> <IP>
: add <IP> to the existing list of ips for <JAIL>bkctld reset-ip <JAIL> <IP>
: replace the existing list of ips for <JAIL> with <IP>bkctld list-ips <JAIL>
: print the existing list of ips for <JAIL>bkctld add-key <JAIL> <KEY_FILE>
: add the key from <KEY_FILE> to the list of authorized keys for <JAIL>bkctld reset-key <JAIL> <KEY_FILE>
: replace the list of authorized keys for <JAIL> with the key from <KEY_FILE>bkctld list-keys <JAIL>
: print the list of authorized keys for <JAIL>bkctld create-incs
: create daily incsbkctld prune-incs
: delete incs according to incs policybkctld list-incs <JAIL>
: print the list of incs for <JAIL>bkctld report-incs [all|last]
: report incs statusbkctld nrpe
: NRPE-compatible check (mounted partition, jails last log…)bkctld archive <JAIL>
: archive <JAIL>I would rather have thought of commands like "command subcommand action", as it is used in many commands : systemctl, rcctl, bgpctl, ospfctl, …
That would give :
And I don't know if this belongs here, but it would be perfect with auto completion.
I agreed with @jdubois here.
I'm also in favor of the command subcommand action pattern here.
Also, maybe use the word
replace
instead ofreset
for IP/Key change.I really like the pattern
bkctld <subcommand> <action> [<option>]
. It looks a bit like the "ip" command. But it's a bit more difficult to implement.If we decide to keep a simpler syntax with just a list of subcommands, we can still compose the subcommand with a prefix and an action, like this :
bkctld ip-add <JAIL> <IP>
: add <IP> to the existing list of ips for <JAIL>bkctld ip-replace <JAIL> <IP>
: replace the existing list of ips for <JAIL> with <IP>bkctld ip-list <JAIL>
: print the existing list of ips for <JAIL>bkctld key-add <JAIL> <KEY_FILE>
: add the key from <KEY_FILE> to the list of authorized keys for <JAIL>bkctld key-replace <JAIL> <KEY_FILE>
: replace the list of authorized keys for <JAIL> with the key from <KEY_FILE>bkctld key-list <JAIL>
: print the list of authorized keys for <JAIL>bkctld inc-create
: create daily incsbkctld inc-prune
: delete incs according to incs policybkctld inc-list <JAIL>
: print the list of incs for <JAIL>bkctld inc-report [all|last|<JAIL>]
: report incs statusbkctld nrpe
: NRPE-compatible check (mounted partition, jails last log…)bkctld archive <JAIL>
: archive <JAIL>This PR is 5years old :o
@jlecour Shall we update it so we can merge it ?
Or do we give-up ?
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.