123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #!/usr/bin/perl
- use strict;
- use warnings;
- use YAML qw(LoadFile DumpFile);
- my $configFile = "$ENV{HOME}/.sshfs-helper";
- my $configData;
- if ((not -e $configFile)) {
- $configData = {};
- DumpFile($configFile, $configData);
- } else {
- $configData = LoadFile($configFile);
- }
- sub addConfig {
-
- }
- sub changeConfig {
-
- }
- sub mount {
-
- }
- sub unmount {
-
- }
- sub list {
- foreach my $name (keys %{$configData}) {
- print " - ${name}\n";
- }
- }
- sub usage {
- print "sshfs-helper [ add | list | edit name | mount name | unmount name | help ]\n";
- }
- sub help {
- usage();
- print <<EOF;
- EOF
- exit 1;
- }
- if (@ARGV == 0) {
- usage();
- exit 1;
- }
- my $command = shift @ARGV;
- my @arguments = @ARGV;
- if ($command eq "add") {
- addConfig(@arguments);
- } elsif ($command eq "list") {
- list();
- } elsif ($command eq "edit") {
- } elsif ($command eq "mount") {
- } elsif ($command eq "unmount") {
- } elsif ($command eq "help") {
- } else {
- usage();
- exit 1;
- }
- DumpFile($configFile, $configData);
|