Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default overridable config for running solutions in particular language #19

Open
ellnix opened this issue Oct 28, 2023 · 0 comments
Labels
feature Feature request

Comments

@ellnix
Copy link
Collaborator

ellnix commented Oct 28, 2023

It would be great if there was a lookup table with language names and the build & run commands that the tool automatically searches for. Some ideas:

# changes the default language to C
clash language c
clash run 
# runs `sol.{language_file_ext}` with default language
clash run --language rust
clash run -l rust
# runs sol.rs with rust

Ideally there would be a config file in $XDG_CONFIG_HOME/clash for Linux and %Appdata%/whatever for Windows like:

# languages.yml
ruby:
  run: ruby sol.rb
c:
  build: gcc sol.c
  run: ./sol
rust:
  run: cargo run --release
  workspace: rust
  code_origin: sol.rs
  code_destination: src/main.rs
- workspaces/
  - rust/
    - src/
    - Cargo.toml

The workspace feature would allow for supporting non standard libraries in languages like Rust. The workflow would be:

  • Edit sol.rs
  • clash run
    • cp {config['rust']['code_origin']} CONFIG_FOLDER/workspaces/{config['rust']['workspace']}/{config['rust']['code_destination']},
      i. e. cp sol.rs CONFIG_FOLDER/workspaces/rust/src/main.rs
    • {config['rust']['run']},
      i. e. cargo run --release
    • Evaluate solution
@ellnix ellnix added the feature Feature request label Oct 28, 2023
daxida referenced this issue in daxida/coctus Mar 22, 2024
Add python templates, refactor codebase and fix bugs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request
Projects
None yet
Development

No branches or pull requests

1 participant