Coder Social home page Coder Social logo

Comments (6)

reaganmcf avatar reaganmcf commented on June 11, 2024

Note: We should actually also do some smart resolution here because cargo run makes no sense for libraries.

If src/lib.rs exists, then exec_commands should be cargo test

from lightmon.

reaganmcf avatar reaganmcf commented on June 11, 2024

This is actually kind of tricky because for each subcommand of cargo there are so many flags people probably want to use. Either we can support them, or just tell them to use shell mode.

While I do think that's definitely the solution for very custom usages, I think we should support some popular flags, for example:

build has many popular flags: --lib, --bin name, --features features, --all-features, --release, --target-dir directory, --out-dir directory, etc.

Which ones should we support?

from lightmon.

reaganmcf avatar reaganmcf commented on June 11, 2024

@alayshahh How do you think we should go about supporting the arguments to the subcommands. The linked PR has working subcommands but you can't pass any arguments into it yet, still waiting to figure out how we want to do this.

from lightmon.

alayshahh avatar alayshahh commented on June 11, 2024

It might be a but difficult without the lightmon.toml file. If we can we can store args for the different cargo sub commands like this. Another adaptation we can have is take anything after the 'lightmon rust' arg and pass it to the command. If no args, we can just default to 'cargo run'

from lightmon.

reaganmcf avatar reaganmcf commented on June 11, 2024

Yea because I don't want to not have some features and would rather have a dynamic way to allow all flags (current and new ones in the future).

For example, running lightmon rust doc --arg1 foo --bar bazz would pass --arg1 foo --bar bazz to cargo doc without us having to specify the arguments explicitly in cli.yaml

from lightmon.

reaganmcf avatar reaganmcf commented on June 11, 2024

@alayshahh The latest commit to the PR fixes this and makes the usage must more expressive and realistic.

Any subcommands after lightmon rust get parsed using clap's AppSetting::ExternalSubcommands global setting. This means the following:

lightmon rust build --bin my_bin --all-targets

Will resolve the exec command as cargo build --bin my_bin --all-targets

from lightmon.

Related Issues (18)

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.