Skip to content

Commit

Permalink
Remove hello-world from example options
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Jan 19, 2024
1 parent 4f7eac4 commit ffc4d80
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cmd/soroban-cli/src/commands/contract/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub enum ExampleContract {
Errors,
Events,
Fuzzing,
HelloWorld,
Increment,
LiquidityPool,
Logging,
Expand All @@ -31,7 +30,6 @@ pub enum ExampleContract {
Timelock,
Token,
UpgradeableContract,
None,
}

impl fmt::Display for ExampleContract {
Expand All @@ -49,7 +47,6 @@ impl fmt::Display for ExampleContract {
ExampleContract::Errors => write!(f, "errors"),
ExampleContract::Events => write!(f, "events"),
ExampleContract::Fuzzing => write!(f, "fuzzing"),
ExampleContract::HelloWorld => write!(f, "hello_world"),
ExampleContract::Increment => write!(f, "increment"),
ExampleContract::LiquidityPool => write!(f, "liquidity_pool"),
ExampleContract::Logging => write!(f, "logging"),
Expand All @@ -58,7 +55,6 @@ impl fmt::Display for ExampleContract {
ExampleContract::Timelock => write!(f, "timelock"),
ExampleContract::Token => write!(f, "token"),
ExampleContract::UpgradeableContract => write!(f, "upgradeable_contract"),
ExampleContract::None => write!(f, "none"),
}
}
}
Expand All @@ -68,8 +64,8 @@ impl fmt::Display for ExampleContract {
pub struct Cmd {
pub project_path: String,

/// optional flag to specify soroban example contracts to include
#[arg(short, long, num_args = 1..=20, default_value = "none")]
/// An optional flag to specify Soroban example contracts to include. A hello-world contract will be included by default.
#[arg(short, long, num_args = 1..=20)]
pub with_example: Vec<ExampleContract>,
}

Expand Down Expand Up @@ -180,7 +176,7 @@ fn file_exists(file_path: &str) -> bool {
}

fn include_example_contracts(contracts: &[ExampleContract]) -> bool {
!(contracts.len() == 1 && contracts[0] == ExampleContract::None)
contracts.len() >= 1
}

fn clone_repo(from_url: &str, to_path: &Path) -> Result<(), Error> {
Expand Down

0 comments on commit ffc4d80

Please sign in to comment.