Skip to content

Commit

Permalink
Add support for --license arg (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
smiasojed authored Aug 29, 2024
1 parent d763e30 commit 41c8d4e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ jobs:

- name: Test CLI
run: make test-cli

- uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}-resolc
path: ./target/release/resolc
retention-days: 1
4 changes: 4 additions & 0 deletions crates/solidity/src/resolc/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ pub struct Arguments {
#[structopt(long = "version")]
pub version: bool,

/// Print the licence and exit.
#[structopt(long = "license")]
pub license: bool,

/// Specify the input paths and remappings.
/// If an argument contains a '=', it is considered a remapping.
/// Multiple Solidity files can be passed in the default Solidity mode.
Expand Down
8 changes: 8 additions & 0 deletions crates/solidity/src/resolc/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ fn main_inner() -> anyhow::Result<()> {
return Ok(());
}

if arguments.license {
let license_mit = include_str!("../../../../LICENSE-MIT");
let license_apache = include_str!("../../../../LICENSE-APACHE");

println!("{}\n{}\n", license_mit, license_apache);
return Ok(());
}

rayon::ThreadPoolBuilder::new()
.stack_size(RAYON_WORKER_STACK_SIZE)
.build_global()
Expand Down

0 comments on commit 41c8d4e

Please sign in to comment.