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 --interactive flag to bugwarrior-pull. #277

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions bugwarrior/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def _get_section_name(flavor):
@click.command()
@click.option('--dry-run', is_flag=True)
@click.option('--flavor', default=None, help='The flavor to use')
def pull(dry_run, flavor):
@click.option('--interactive', is_flag=True)
def pull(dry_run, flavor, interactive):
""" Pull down tasks from forges and add them to your taskwarrior tasks.

Relies on configuration in bugwarriorrc
Expand All @@ -42,7 +43,7 @@ def pull(dry_run, flavor):
main_section = _get_section_name(flavor)

# Load our config file
config = load_config(main_section)
config = load_config(main_section, interactive)

tw_config = TaskWarriorBase.load_config(get_taskrc_path(config, main_section))
lockfile_path = os.path.join(
Expand Down
4 changes: 2 additions & 2 deletions bugwarrior/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def validate_config(config, main_section):
get_service(service).validate_config(config, target)


def load_config(main_section):
def load_config(main_section, interactive=False):
config = ConfigParser({'log.level': "DEBUG", 'log.file': None})
path = None
first_path = BaseDirectory.load_first_config('bugwarrior')
Expand All @@ -152,7 +152,7 @@ def load_config(main_section):
"utf-8",
)
)
config.interactive = False # TODO: make this a command-line option
config.interactive = interactive
validate_config(config, main_section)

return config
Expand Down