linuxcaffe / vcf

vCard find
GNU General Public License v3.0
0 stars 0 forks source link

use $VCF_FILE environment variable as default #4

Open linuxcaffe opened 9 years ago

linuxcaffe commented 9 years ago

If vcf looked for a $VCF_FILE envar, then the source-file/folder could be omitted.

./vcf.sh jane ~/contacts/*.vcf

becomes (after putting it in the $PATH)

vcf jane

Other *.vcf files/folders could still be queried by including the path/to/other.vcf

l0b0 commented; Since globbing is a shell expansion, that would not work as you expect. For example, if you declared VCFFILE='~/contacts/.vcf' every nix tool would look for the literal single file path ~/contacts/_.vcf, which is a valid path. And there would literally be no way to pass multiple filenames without inventing a custom escaping or quoting scheme, since POSIX doesn't support array variables. Declaring VCF_FILE=~/contacts/.vcf (without the quotes) would expand the tilde and glob, but you can either treat that as one filename (like almost all *nix tools do) or as multiple filenames, at which point you can no longer support filenames containing spaces. See Greg's Wiki article on arguments for more.

linuxcaffe commented 9 years ago

for me, *nix user who doesn't ever use spaces in filenames, I think that would be ok.

What I'm hoping to achieve is a default *.vcf source, if no trailing uri is used (in case that was unclear).