pub enum Commands {
Run {
host: HostArg,
cwd: Option<String>,
max_secs: Option<u64>,
wait: bool,
no_tail: bool,
cmd: Vec<String>,
},
Poll {
id: JobId,
host: HostArg,
json: bool,
},
Wait {
id: JobId,
host: HostArg,
timeout: Option<u64>,
},
Tail {
id: JobId,
host: HostArg,
follow: bool,
all: bool,
lines: Option<u64>,
},
Ls {
host: HostArg,
all: bool,
json: bool,
full: bool,
},
Kill {
id: JobId,
host: HostArg,
rm: bool,
},
Rm {
id: Option<JobId>,
all: bool,
host: HostArg,
},
Host(HostCmd),
}Variants§
Run
Dispatch a command and print its job id
Fields
cmd: Vec<String>The command to run.
Everything after the first word is part of the command, so coop’s
own flags go BEFORE it: coop run --wait ls, not
coop run ls --wait. Use -- when the command takes flags coop
also has: coop run -- ls --all.
stdout and stderr are merged into one log, in the order the job wrote them; redirect inside your command to separate them.
Do NOT pipe the command into head or tail to keep the log small.
rc becomes the pipe’s – measured: sh -c 'echo x; exit 1' | tail -3 exits 0 – so a failed job reports success and any &&
after it runs anyway, and rc is the artifact coop’s whole design
rests on. Let the job be the work and let coop shape the output:
coop tail <id> -n 3, or plain coop tail <id>, which already
caps the read at 64KB. If your remote sh supports it,
set -o pipefail keeps a genuine pipeline honest; it is not
portable POSIX, so coop does not add it for you – the command is
yours.
Poll
Print state, but no job output; prints nothing from the job; use coop tail
What coop tail gives you is one log: stdout and stderr are merged into
one log, in the order the job wrote them; redirect inside your command
to separate them.
Wait
Block until done; prints nothing; use coop tail
What coop tail gives you is one log: stdout and stderr are merged into
one log, in the order the job wrote them; redirect inside your command
to separate them.
Fields
Tail
Print a job’s merged stdout and stderr as raw bytes
stdout and stderr are merged into one log, in the order the job wrote them; redirect inside your command to separate them. There is one artifact per job on purpose: splitting it would mean two files, two probe offsets, and a lost interleaving, to serve a case a redirect in your own command already covers.
Fields
Ls
List jobs
The human table collapses whitespace and truncates commands to keep one job on one scannable line. Use –full to read a long command, –json for the machine surface.
Fields
Kill
Kill a running job
Fields
Rm
Drop a job’s state directory
Fields
Host(HostCmd)
Inspect configured hosts
Trait Implementations§
Source§impl FromArgMatches for Commands
impl FromArgMatches for Commands
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Commands
impl Subcommand for Commands
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommand