Comments (3)
I think this can be done by making the argument spec
as variadic argument (accepting infinte arguments and setting it as required such that at least one arg is required.). Then iterating through all values, removing them one by one.
[...]
@click.argument('spec', nargs=-1, required=True)
[...]
for sp in spec:
helpers.entity_remove(api.TimeEntry, sp, ('id', 'description'), obj=ctx.obj)
[...]
While this implementation prevents breaking previous versions, it has an issue. If one of the amidst time entry doesn't exist, the program halts. Is there any way to prevent this issue?
from toggl-cli.
How exactly does it halt? Does it just throw an exception? Can't you wrap that in a try/except
block?
from toggl-cli.
In entity remove, this line halts the program if entry is not found.
[...]
def entity_remove():
[...]
if not entities:
click.echo('{} not found!'.format(cls.get_name(verbose=True)), color=theme.error_color)
exit(44)
[...]
While exit(44) can be removed, the terminal returns exit status 0 even if not found.
from toggl-cli.
Related Issues (20)
- Autocomplete: Compdef: command not found HOT 2
- Is it possible to pass argument for billable/non billable ? HOT 4
- No way to disable billable when starting an issue HOT 2
- Update API Url Domain to api.track.toggl.com HOT 3
- Test failures
- Some more CLI example, please HOT 1
- Project Add command incorrectly claims created projects are public by default
- CLI should not show entry is running when time entry has stop == start HOT 3
- sum command doesn't respect configured timezone HOT 1
- Option to set task? HOT 4
- Rework CLI completion with new Click 8.0 release HOT 1
- Unable to find user for TimeEntry HOT 1
- Add `--colors=always` option for passing to `click` HOT 2
- Authentication fail on "ls" command -- but works for other commands
- How do I find entries without project? HOT 1
- Install completion to $ZDOTDIR/.zshrc HOT 4
- toggl projects add -n "asd asd" --color 123 HOT 3
- Flag to quickly do `toggl stop -p $TIME; toggl start -s $TIME ...` HOT 3
- API v8 is being deprecated and shut down by toggle HOT 12
- [Feature request] rewrite in javascript HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toggl-cli.