Skip to content

Commit 6cb7ba9

Browse files
committed
Update README
1 parent bd3b91d commit 6cb7ba9

File tree

2 files changed

+139
-6
lines changed

2 files changed

+139
-6
lines changed

README.md

Lines changed: 139 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,142 @@
1-
# Diadog
1+
# diadog
22

3-
> Diadog, your loyal dialog companion. Binaries to open native file dialogs on multiple platforms.
3+
> diadog, your loyal file dialog companion. Binaries to open native file dialogs on multiple platforms.
44
5-
Linux: libgtk-3-dev libdbus-1-dev
5+
diadog is a collection of pre-built binaries for the most common desktop platforms which enables you to open native file dialogs easily and in a standardized manner, and receive the paths selected by the user back as a string.
66

7-
Windows: ole32.lib uuid.lib
7+
This toolkit supports multiple forms of file dialogs, namely:
8+
- Selecting a single file
9+
- Selecting multiple files
10+
- Selecting folders
11+
- Selecting an output file
12+
13+
All file-related actions can optionally be supplied with a set of allowed file extensions to restrict the user input.
14+
15+
diadog supports the following platforms:
16+
- Windows x64
17+
- macOS x64
18+
- Linux x64 (with GTK)
19+
20+
Support for more platform is planned, specifically:
21+
- Windows x32
22+
- macOS arm64
23+
- Linux x64 (no GTK)
24+
25+
## Samples
26+
```bash
27+
$ dopen single
28+
> "/Users/test/Documents/file.pdf"
29+
```
30+
31+
```bash
32+
$ dopen many
33+
> "/Users/test/Documents/file1.pdf"
34+
> "/Users/test/Documents/file2.pdf"
35+
> "/Users/test/Documents/file3.pdf"
36+
```
37+
38+
```bash
39+
$ dsave single
40+
> "/Users/test/Documents/out.txt"
41+
```
42+
43+
## Usage
44+
45+
### `dopen`
46+
```bash
47+
Usage is like:
48+
dopen {SUBCMD} [subcommand-opts & args]
49+
where subcommand syntaxes are as follows:
50+
51+
single [optional-params]
52+
Select a single file.
53+
Options:
54+
-p=, --path= string "" The path to open by default.
55+
--packages= strings {} The display name of a set of file types to match.
56+
-f=, --filters= strings {} The file types to match, in the order of the specified packages.
57+
58+
many [optional-params]
59+
Select one or more files.
60+
Options:
61+
-p=, --path= string "" The path to open by default.
62+
--packages= strings {} The display name of a set of file types to match.
63+
-f=, --filters= strings {} The file types to match, in the order of the specified packages.
64+
65+
folder [optional-params]
66+
Select a folder.
67+
Options:
68+
-p=, --path= string "" The path to open by default.
69+
```
70+
71+
### `dsave`
72+
```bash
73+
Usage is like:
74+
dsave {SUBCMD} [subcommand-opts & args]
75+
where subcommand syntaxes are as follows:
76+
77+
single [optional-params]
78+
Save to a single file.
79+
Options:
80+
-n=, --name= string "" The name to use by default.
81+
-p=, --path= string "" The path to open by default.
82+
--packages= strings {} The display name of a set of file types to match.
83+
-f=, --filters= strings {} The file types to match, in the order of the specified packages.
84+
```
85+
86+
### Notes
87+
When supplying multiple filters, the first one will be used as the default file extension. For example, if you supply filters for two distinct packages for ZIP's and JPG's, in that order, the default file extension will be `.zip`.
88+
89+
### Example Invocations
90+
91+
#### `dopen`
92+
##### Setting a custom start path
93+
```bash
94+
dopen single --path="/Users/test/Documents"
95+
```
96+
97+
##### Setting valid file extensions
98+
```bash
99+
dopen single --pack="Image" --filter="jpg,jpeg"
100+
```
101+
102+
##### Setting multiple valid file extensions
103+
```bash
104+
dopen single --pack="Image" --filter="jpg,jpeg" --pack="Archices" --filter="zip,tar,gz,rar"
105+
```
106+
107+
#### `dsave`
108+
##### Setting a custom start path
109+
```bash
110+
dsave single --path="/Users/test/Documents"
111+
```
112+
113+
##### Setting valid file extensions
114+
```bash
115+
dsave single --pack="Image" --filter="jpg,jpeg"
116+
```
117+
118+
##### Setting multiple valid file extensions
119+
```bash
120+
dsave single --pack="Image" --filter="jpg,jpeg" --pack="Archices" --filter="zip,tar,gz,rar"
121+
```
122+
123+
## Building
124+
Building diadog
125+
126+
### Linux
127+
Ensure that `libgtk-3-dev` is installed.
128+
```bash
129+
nimble build_all_linux
130+
```
131+
132+
### Windows
133+
The recommended way is to cross-compile from Linux via MingW. No extra dependencies are required.
134+
```bash
135+
nimble build_all_windows
136+
```
137+
138+
### macOS
139+
No extra dependencies are required.
140+
```bash
141+
nimble build_all_macos
142+
```

src/dopen.nim

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import wrapper
66

77
proc single*(path = "", packages: seq[string] = @[], filters: seq[string] = @[]) =
88
## Select a single file.
9-
# Example:
10-
# open single --pack="Scenario_Archive" -f="zip" --pack="Image" -f="jpg,jpeg"
119
if packages.len != filters.len:
1210
echo "Please specify a matching number of package names and filters."
1311
quit(1)

0 commit comments

Comments
 (0)