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 c2a2f22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 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
6 changes: 2 additions & 4 deletions docs/soroban-cli-full-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,11 +680,9 @@ Initialize a Soroban project with an example contract

###### **Options:**

* `-w`, `--with-example <WITH_EXAMPLE>` — optional flag to specify soroban example contracts to include
* `-w`, `--with-example <WITH_EXAMPLE>`An optional flag to specify Soroban example contracts to include. A hello-world contract will be included by default

Default value: `none`

Possible values: `account`, `alloc`, `atomic-multiswap`, `atomic-swap`, `auth`, `cross-contract`, `custom-types`, `deep-contract-auth`, `deployer`, `errors`, `events`, `fuzzing`, `hello-world`, `increment`, `liquidity-pool`, `logging`, `simple-account`, `single-offer`, `timelock`, `token`, `upgradeable-contract`, `none`
Possible values: `account`, `alloc`, `atomic-multiswap`, `atomic-swap`, `auth`, `cross-contract`, `custom-types`, `deep-contract-auth`, `deployer`, `errors`, `events`, `fuzzing`, `increment`, `liquidity-pool`, `logging`, `simple-account`, `single-offer`, `timelock`, `token`, `upgradeable-contract`



Expand Down

0 comments on commit c2a2f22

Please sign in to comment.