File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,19 @@ command :teller do |c|
5656 c . action do |args , options |
5757 raise ArgumentError . new ( "token is required!" ) unless options . token
5858 raise ArgumentError . new ( "ynab_account_id is required!" ) unless options . ynab_account_id
59- raise ArgumentError . new ( "teller_account_id is required!" ) unless options . teller_account_id
59+
60+ unless options . teller_account_id
61+ accounts = Import ::Teller . new ( options . token , nil , nil ) . accounts
62+ accounts . each . with_index do |account , index |
63+ puts "[#{ index } ] #{ account [ :institution ] } (#{ account [ :name ] } )"
64+ end
65+ puts ''
66+
67+ selected_account = ask ( "Account ID: " , Integer )
68+ options . teller_account_id = accounts [ selected_account ] [ :id ]
69+ raise ArgumentError . new ( "Teller account not found" ) unless options . teller_account_id
70+ end
71+
6072 Import ::Teller . new ( options . token , options . teller_account_id , options . ynab_account_id ) . import
6173 end
6274end
You can’t perform that action at this time.
0 commit comments