Add support for multiple arguments #5
@@ -10,6 +10,8 @@
|
||||
ad [path file or folder]
|
||||
```
|
||||
|
||||
And it supports multiple arguments!
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
@@ -32,6 +34,34 @@ airport/
|
||||
│ ├── captain.txt
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```bash
|
||||
ad airport/ train-station/train.txt
|
||||
```
|
||||
|
||||
```
|
||||
airport/
|
||||
├── plane/
|
||||
train-station/
|
||||
├── train.txt
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```bash
|
||||
# If your shell supports arguments expansion
|
||||
ad airport/plane/{captain,passenger}.txt
|
||||
```
|
||||
|
||||
```
|
||||
airport/
|
||||
├── plane/
|
||||
│ ├── captain.txt
|
||||
│ ├── passenger.txt
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Install
|
||||
|
||||
|
||||
+4
-3
@@ -6,10 +6,11 @@ import os
|
||||
import click
|
||||
|
||||
@click.command()
|
||||
@click.argument('path')
|
||||
@click.argument('paths', nargs=-1)
|
||||
@click.option('-cd/--change', is_flag=True, default=False, help='After creating the directories, change to the new deeper directory.')
|
||||
def advance_touch(path, cd):
|
||||
""" Make folder and files """
|
||||
def advance_touch(paths, cd):
|
||||
""" Make folders and files """
|
||||
for path in paths:
|
||||
# Make folders
|
||||
new_dirs = '/'.join(path.split('/')[0:-1])
|
||||
if not os.path.exists(new_dirs) and new_dirs != '':
|
||||
|
||||
Reference in New Issue
Block a user