Class: Abt::Providers::Asana::Commands::Clear
Instance Attribute Summary
Attributes inherited from BaseCommand
#config, #path
Attributes inherited from BaseCommand
#ari, #cli, #flags
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseCommand
#initialize
Methods inherited from BaseCommand
#initialize
Class Method Details
.description ⇒ Object
12
13
14
|
# File 'lib/abt/providers/asana/commands/clear.rb', line 12
def self.description
"Clear asana configuration"
end
|
.flags ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/abt/providers/asana/commands/clear.rb', line 16
def self.flags
[
["-g", "--global",
"Clear global instead of local asana configuration (credentials etc.)"],
["-a", "--all", "Clear all asana configuration"]
]
end
|
.usage ⇒ Object
8
9
10
|
# File 'lib/abt/providers/asana/commands/clear.rb', line 8
def self.usage
"abt clear asana"
end
|
Instance Method Details
24
25
26
27
28
29
30
31
|
# File 'lib/abt/providers/asana/commands/clear.rb', line 24
def perform
abort("Flags --global and --all cannot be used together") if flags[:global] && flags[:all]
config.clear_local unless flags[:global]
config.clear_global if flags[:global] || flags[:all]
warn("Configuration cleared")
end
|