-
Notifications
You must be signed in to change notification settings - Fork 2
/
yandex.nu
55 lines (50 loc) · 889 Bytes
/
yandex.nu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#yandex-disk wrappers
export def ydx [] {
print ([
"yandex-disk wrapper."
"METHODS:"
"- ydx status"
"- ydx start"
"- ydx stop"
"- ydx help"
"- ydx last"
]
| str join "\n"
)
}
#yandex-disk status
export def "ydx status" [] {
yandex-disk status
| grep -E "Sync|Total|Used|Trash"
| lines
| split column ':'
| str trim
| rename item status
}
#yandex-disk start
export def "ydx start" [] {
yandex-disk start
}
#yandex-disk stop
export def "ydx stop" [] {
yandex-disk stop
}
#yandex-disk help
export def "ydx help" [] {
yandex-disk --help
}
#yandex disk last synchronized items
export def "ydx last" [] {
yandex-disk status
| split row "Last synchronized items:"
| last
| str trim
| lines
| str trim
| each {|it|
$it
| split row "file: "
| last
| str replace -a "'" ""
}
}