Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 committed Oct 3, 2024
1 parent 2a4954e commit f35ce48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
29 changes: 14 additions & 15 deletions cargo-shuttle/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ use shuttle_common::resource;
pub struct ShuttleArgs {
#[command(flatten)]
pub project_args: ProjectArgs,
/// Run this command against the API at the supplied URL
/// (allows targeting a custom deployed instance for this command only, mainly for development)
/// URL for the Shuttle API to target (mainly for development)
#[arg(global = true, long, env = "SHUTTLE_API")]
pub api_url: Option<String>,
/// Disable network requests that are not strictly necessary. Limits some features.
Expand All @@ -46,7 +45,7 @@ pub struct ShuttleArgs {
pub cmd: Command,
}

// Common args for subcommands that deal with projects.
/// Global args for subcommands that deal with projects
#[derive(Parser, Clone, Debug)]
pub struct ProjectArgs {
/// Specify the working directory
Expand Down Expand Up @@ -102,20 +101,20 @@ impl ProjectArgs {
pub enum Command {
/// Generate a Shuttle project from a template
Init(InitArgs),
/// Run a Shuttle service locally
/// Run a project locally
Run(RunArgs),
/// Deploy a Shuttle service
/// Deploy a project
Deploy(DeployArgs),
/// Manage deployments of a Shuttle service
/// Manage deployments
#[command(subcommand, visible_alias = "depl")]
Deployment(DeploymentCommand),
/// View the status of a Shuttle service
Status,
/// Stop a Shuttle service
Stop,
/// View logs of a Shuttle service
/// View build and deployment logs
Logs(LogsArgs),
/// Manage projects on Shuttle
/// Manage Shuttle projects
#[command(subcommand, visible_alias = "proj")]
Project(ProjectCommand),
/// Manage resources
Expand All @@ -129,7 +128,7 @@ pub enum Command {
/// Show info about your Shuttle account
#[command(visible_alias = "acc")]
Account,
/// Login to the Shuttle platform
/// Log in to the Shuttle platform
Login(LoginArgs),
/// Log out of the Shuttle platform
Logout(LogoutArgs),
Expand Down Expand Up @@ -162,8 +161,8 @@ pub enum GenerateCommand {

#[derive(Parser)]
pub struct TableArgs {
#[arg(long, default_value_t = false)]
/// Output tables without borders
#[arg(long, default_value_t = false)]
pub raw: bool,
}

Expand All @@ -172,12 +171,12 @@ pub enum DeploymentCommand {
/// List the deployments for a service
#[command(visible_alias = "ls")]
List {
#[arg(long, default_value = "1")]
/// Which page to display
#[arg(long, default_value = "1")]
page: u32,

#[arg(long, default_value = "10", visible_alias = "per-page")]
/// How many deployments per page to display
#[arg(long, default_value = "10", visible_alias = "per-page")]
limit: u32,

#[command(flatten)]
Expand All @@ -200,8 +199,8 @@ pub enum ResourceCommand {
#[command(flatten)]
table: TableArgs,

#[arg(long, default_value_t = false)]
/// Show secrets from resources (e.g. a password in a connection string)
#[arg(long, default_value_t = false)]
show_secrets: bool,
},
/// Delete a resource
Expand Down Expand Up @@ -246,9 +245,9 @@ pub enum ProjectCommand {
Start(ProjectStartArgs),
/// Check the status of this project's environment on Shuttle
Status {
#[arg(short, long)]
/// Follow status of project
// unused in beta (project has no state to follow)
#[arg(short, long)]
follow: bool,
},
/// Destroy this project's environment (container) on Shuttle
Expand Down Expand Up @@ -276,8 +275,8 @@ pub enum ProjectCommand {

#[derive(Parser, Debug)]
pub struct ConfirmationArgs {
#[arg(long, short, default_value_t = false)]
/// Skip confirmations and proceed
#[arg(long, short, default_value_t = false)]
pub yes: bool,
}

Expand Down
6 changes: 3 additions & 3 deletions cargo-shuttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Shuttle {
| Command::Account
| Command::Project(ProjectCommand::Link)
) {
bail!("This command is not supported on the old platform (shuttle.rs).");
bail!("This command is not supported on the OLD platform (shuttle.rs).");
}

if self.beta {
Expand All @@ -190,7 +190,7 @@ impl Shuttle {
if (!self.beta && url != API_URL_DEFAULT) || (self.beta && url != API_URL_BETA) {
eprintln!(
"{}",
format!("INFO: Targeting non-standard API: {url}").yellow(),
format!("INFO: Targeting non-default API: {url}").yellow(),
);
}
if url.ends_with('/') {
Expand Down Expand Up @@ -1124,7 +1124,7 @@ impl Shuttle {

async fn logs_beta(&self, args: LogsArgs) -> Result<()> {
if args.follow {
eprintln!("Streamed logs are not yet supported on beta.");
eprintln!("Streamed logs are not yet supported on the new platform.");
return Ok(());
}
// TODO: implement logs range
Expand Down

0 comments on commit f35ce48

Please sign in to comment.