Skip to content

Commit

Permalink
Add --interactive flag to bugwarrior-pull.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryneeverett committed Feb 17, 2016
1 parent ee2ad20 commit b8032db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit b8032db

Please sign in to comment.