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 for tackler new and init commands #46

Closed
35VLG84 opened this issue Jan 12, 2025 · 0 comments · Fixed by #52
Closed

Add for tackler new and init commands #46

35VLG84 opened this issue Jan 12, 2025 · 0 comments · Fixed by #52
Labels
good first issue Good for newcomers

Comments

@35VLG84
Copy link
Collaborator

35VLG84 commented Jan 12, 2025

Topics

With this issue you will get familiar with Rust's command line parser named Clap and you will operate with basic file IO. There is no need for understanding of Tackler-NG needed, but you will get familiar how its command line processing is working.

Introduction

It would be great to have tackler new and tackler init commands to create basic setup.

These would behave similarly as cargo new and cargo init, and do following steps:

  1. Creates or initialize basic directory structure
  2. Add default configuration files
  3. Add an example transaction

Currently --config is mandatory argument, but this has to be changed so that there must be either --config, new or init.

Directory structure

The basic setup is following, and this should be created by new or init command:

<name>/
└── journal/
    ├── conf/
    │   ├── tackler.toml
    │   ├── accounts.toml
    │   ├── commodities.toml
    │   └── tags.toml
    └── txns/
        └── welcome.txn

Correct content for configuration is located in files:

This must be implemented without any new dependencies (e.g. no new template crates). The content of all above files must be included into binary. That content of above files should be in each own Rust source code files, so that it's easy to update the content, and it's separated from actual code.

Testing

This functionality should be tested following way:

# create new setup
tackler new test
# verify tthe default configuration
tackler new --config test/journal/conf/tackler.toml

The integration tests are under tests/sh and test are run by test-runner-ng.sh

Pointers

  • CLI arguments (clap)
  • Tackler main
  • Clap Subcommands
    • and "When specifying commands with command: Commands, they are required. Alternatively, you could do command: Option<Commands> to make it optional."

How to proceed

Thank you for thinking to contribute to Tackler-NG!

If you have any question, you could ask those here on this ticket or open new discussion (if you think it would take longer discussion). Read also Developer Documentation.

Happy hacking!

@35VLG84 35VLG84 added the good first issue Good for newcomers label Jan 12, 2025
@35VLG84 35VLG84 changed the title Implement tackler new and init commands Add for tackler new and init commands Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant