Code Monkey home page Code Monkey logo

argopt's People

Contributors

tanakh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

argopt's Issues

Did not compile without structopt crate

Projects using argopt did not compile.

Reproduction

$ mkdir reproduction
$ cd reproduction 
$ cargo init      
     Created binary (application) package
$ rustc --version
rustc 1.43.0 (4fb7144ed 2020-04-20)
$ echo 'argopt = "0.1.1"' >> Cargo.toml 
$ cat Cargo.toml            
[package]
name = "reproduction"
version = "0.1.0"
authors = ["Yusuke Sangenya <[email protected]>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
argopt = "0.1.1"

$ cat > src/main.rs <<SRC
use argopt::cmd;

#[cmd]
fn main(
    #[opt(short = "b", long = "bin")] bin: Option<f64>,
    #[opt(short = "w", long = "screen-width", default_value = "80")] screen_width: i64,
) {
    println!("{:?}", bin);
    println!("{}", screen_width);
}
SRC

$ cargo build            
    Updating crates.io index
   Compiling proc-macro2 v1.0.21
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.41
   Compiling version_check v0.9.2
   Compiling libc v0.2.77
   Compiling fnv v1.0.7
   Compiling strsim v0.9.3
   Compiling bitflags v1.2.1
   Compiling ident_case v1.0.1
   Compiling unicode-width v0.1.8
   Compiling unicode-segmentation v1.6.0
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.2
   Compiling ansi_term v0.11.0
   Compiling lazy_static v1.4.0
   Compiling textwrap v0.11.0
   Compiling heck v0.3.1
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling quote v1.0.7
   Compiling atty v0.2.14
   Compiling clap v2.33.3
   Compiling darling_core v0.10.2
   Compiling structopt-derive v0.4.10
   Compiling darling_macro v0.10.2
   Compiling darling v0.10.2
   Compiling argopt-impl v0.1.0
   Compiling structopt v0.3.17
   Compiling argopt v0.1.1
   Compiling reproduction v0.1.0 (/home/sangenya/dev/reproduction)
error[E0433]: failed to resolve: could not find `structopt` in `{{root}}`
 --> src/main.rs:3:1
  |
3 | #[cmd]
  | ^^^^^^ could not find `structopt` in `{{root}}`
  |
  = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `structopt` in `{{root}}`
 --> src/main.rs:3:1
  |
3 | #[cmd]
  | ^^^^^^ could not find `structopt` in `{{root}}`
  |
  = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0433`.
error: could not compile `reproduction`.

To learn more, run the command again with --verbose.

Workaround

Adding structopt to dependency solved this issue.

$ echo 'structopt = "*"' >> Cargo.toml 
$ cargo build
   Compiling reproduction v0.1.0 (/home/sangenya/dev/reproduction)
    Finished dev [unoptimized + debuginfo] target(s) in 0.73s

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.