diff --git a/src/cli/opts.rs b/src/cli/opts.rs index 0eec05c..ec39c11 100644 --- a/src/cli/opts.rs +++ b/src/cli/opts.rs @@ -1,4 +1,5 @@ use crate::{ + cli::complete::complete_project_id, data::{ project_id::{ProjectId, ProjectIdParseError}, renku_url::RenkuUrl, @@ -9,6 +10,7 @@ use crate::{ use super::cmd::*; use clap::{Parser, ValueEnum, ValueHint}; +use clap_complete::ArgValueCompleter; use clap_verbosity_flag::{Verbosity, WarnLevel}; use serde::{Deserialize, Serialize}; use snafu::{ResultExt, Snafu}; @@ -41,7 +43,7 @@ pub struct CommonOpts { /// present commands can use it to confine there functionality to /// this project. The value may be the project id (ulid) or the /// path like /. - #[arg(long, value_hint = ValueHint::Url)] + #[arg(long, value_hint=ValueHint::Other,add = ArgValueCompleter::new(complete_project_id))] pub project_context: Option, /// Set a proxy to use for doing http requests. By default, the diff --git a/src/httpclient/data.rs b/src/httpclient/data.rs index f75a5ff..29c92be 100644 --- a/src/httpclient/data.rs +++ b/src/httpclient/data.rs @@ -44,6 +44,8 @@ pub enum SessionMode { Interactive, #[serde(rename = "non-interactive")] NonInteractive, + #[serde(rename = "app")] + App, } impl fmt::Display for SessionMode { @@ -57,6 +59,7 @@ impl SessionMode { match self { SessionMode::Interactive => "interactive", SessionMode::NonInteractive => "non-interactive", + SessionMode::App => "app", } } }