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

Allow overriding task data and taskrc file on the command line #258

Open
fdela opened this issue Jul 26, 2020 · 3 comments
Open

Allow overriding task data and taskrc file on the command line #258

fdela opened this issue Jul 26, 2020 · 3 comments

Comments

@fdela
Copy link
Collaborator

fdela commented Jul 26, 2020

Currently, taskrc file location is overridable in vit config.ini file (and indirectly via TASKRC envvar)

[taskwarrior]

# Full path to the Taskwarrior configuration file. Tilde will be expanded to the user's home directory.
# NOTE: This setting is overridden by the TASKRC environment variable.
#taskrc = ~/.taskrc

TaskWarrior gives two ways to override config file and data location, via command-line or environment:

Config file Data location
Command-line
argument
rc:config_file rc.data.location:data_directory
Environment
variable
TASKRC=config_file TASKDATA=data_directory

See CONFIGURATION FILE AND OVERRIDE OPTIONS section in task(1) manpage for details.

Overriding manually the environment via TASKRC and TASKDATA (used by TaskWarrior) before launching vit works currently, and shown data/used config are correct.

What would be useful it to be able to specify those via vit command line, as task does:

task rc.data.location:alternateDataLocationDirectory rc:alternateTaskrcConfFile ...

This would allow for instance to have completely separate environments, without having to rely on contexts (where it's a soft separation).

Linked issues: #257 and #235

@thehunmonkgroup
Copy link
Member

See #257 for the suggestion there, perhaps a single --default-args switch?

@fdela
Copy link
Collaborator Author

fdela commented Aug 8, 2020

See #257 for the suggestion there, perhaps a single --default-args switch?

Yes, a --default-args would do, to pass to every taskwarrior command.
Care should be taken to respect precedence of options, so they are applied by increasing precedence: config.ini -> environment variable -> command line option

E.g. taskrc option in config.ini -> TASKRC -> --default-args rc:...

@thehunmonkgroup
Copy link
Member

I've abandoned the idea of a --default-args approach, too complicated.

I've also abandoned the idea of any VIT-specific overrides for task data, see #257 (comment) for more.

I'd still consider adding a CLI arg that would allow overriding the task data location -- this is reasonably straightforward, compliments the existing config file option, and allows for more flexibility for those using more complex setups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants