read meta-url from variable
What would you like to be added:
juicefs cli should read meta-url from an environment variable by if set.
I suggest JFS_URL
If the meta-url is specified on the command line, it should take precedence.
Why is this needed:
it makes the cli nicer to use not having to specify the url each time it is required.
Agree, but it would make more sense to be META_URL, as META_PASSWORD already exists.
agree, would like to see all juicefs variables prefixed as is common elsewhere -- JFS_ or JUICEFS_
So if I run juicefs mount xxx, xxx would be interpreted as the mount point while the URL is read from the environment variable?
What if I only specify the URL and miss the mount point?
So if I run juicefs mount xxx, xxx would be interpreted as the mount point while the URL is read from the environment variable?
Yes. If $JUICEFS_META_URL is set, it fits a validation schema and xxx is a directory.
What if I only specify the URL and miss the mount point?
Following the same steps above, the URL fits validation URL schema then it will error on no mount point specified.
It's better to keep the command arguments consistent.
The sync command read the meta-url from environment variable, which use the volume name as the name, for example,
myfs=redis://localhost/ juicefs sync jfs://myfs/prefix s3://mybucket/prefix
It support multiple volumes in the same time, maybe we can do the same thing here:
myjfs=redis://localhost/ juicefs mount myjfs /mnt
But, we use redis:// as the default schema, and the myjfs will be treated as hostname rather than a variable name.
There is not much we can do without breaking existing command options, close it for now.