Radish alpha
r
Radicle Job Collaborative Object
Radicle
Git (anonymous pull)
Log in to clone via SSH
feat! rename subcommands to be more like what rad has
Lars Wirzenius committed 10 months ago
commit 254db8359456dd84f781b9de4abef5305f250b10
parent 0e8b3823f9e146783fc8cc1de08fe5bd33bf4a87
1 file changed +12 -12
modified src/bin/rad-job.rs
@@ -39,10 +39,10 @@ fn fallible_main() -> Result<(), JobError> {
    let args = Args::parse();
    match &args.cmd {
        Cmd::Failed(x) => x.run(&args)?,
-
        Cmd::Job(x) => x.run(&args)?,
-
        Cmd::Jobs(x) => x.run(&args)?,
+
        Cmd::New(x) => x.run(&args)?,
+
        Cmd::List(x) => x.run(&args)?,
        Cmd::Run(x) => x.run(&args)?,
-
        Cmd::ShowJob(x) => x.run(&args)?,
+
        Cmd::Show(x) => x.run(&args)?,
        Cmd::Succeeded(x) => x.run(&args)?,
    }
    Ok(())
@@ -85,23 +85,23 @@ impl Args {

#[derive(Parser)]
enum Cmd {
-
    Job(JobCmd),
-
    Jobs(JobsCmd),
+
    New(NewCmd),
+
    List(ListCmd),
    Run(RunCmd),
-
    ShowJob(ShowJobCmd),
+
    Show(ShowCmd),
    Failed(FailedCmd),
    Succeeded(SucceededCmd),
}

/// List all job COBs for a repository.
#[derive(Parser)]
-
struct JobsCmd {
+
struct ListCmd {
    /// Format output in a more human oriented way than JSON.
    #[clap(long)]
    pretty: bool,
}

-
impl JobsCmd {
+
impl ListCmd {
    fn run(&self, args: &Args) -> Result<(), JobError> {
        let profile = profile()?;
        let repo = args.repository(&profile)?;
@@ -174,12 +174,12 @@ impl JobsList {
/// Write the job ID to the standard output. It is not usually needed,
/// as job COBs are found using the Git commit ID they refer to.
#[derive(Parser)]
-
struct JobCmd {
+
struct NewCmd {
    /// Git object id for the commit.
    oid: Oid,
}

-
impl JobCmd {
+
impl NewCmd {
    fn run(&self, args: &Args) -> Result<(), JobError> {
        let profile = profile()?;
        let repo = args.repository(&profile)?;
@@ -198,12 +198,12 @@ impl JobCmd {

/// Show the job COB for a Git commit.
#[derive(Parser)]
-
struct ShowJobCmd {
+
struct ShowCmd {
    /// Git object for the commit.
    oid: Oid,
}

-
impl ShowJobCmd {
+
impl ShowCmd {
    fn run(&self, args: &Args) -> Result<(), JobError> {
        let profile = profile()?;
        let repo = args.repository(&profile)?;