# Detect if task was present among cli args

**URL:** <https://discuss.gradle.org/t/detect-if-task-was-present-among-cli-args/21241>\
**Category:** Help/Discuss\
**Created:** [January 20, 2017, 10:23am UTC](https://discuss.gradle.org/t/detect-if-task-was-present-among-cli-args/21241 "2017-01-20T10:23:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![guai](https://avatars.discourse-cdn.com/v4/letter/g/7ba0ec/32.png) [@guai](https://discuss.gradle.org/u/guai)\
**Post date:** [January 20, 2017, 10:23am UTC](https://discuss.gradle.org/t/detect-if-task-was-present-among-cli-args/21241/1 "2017-01-20T10:23:10Z")

</div>

Is there a way to distinguish which tasks were typed in by user and which come from dependencies?  
To make something like this:

```
task myCleanTask {
    onlyIf { explicitlyForcedByUser }
    doSomething()
}
```
