sshfs-helper 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/env perl
  2. use strict;
  3. use warnings;
  4. use YAML qw(LoadFile DumpFile);
  5. my $configFile = "$ENV{HOME}/.sshfs-helper";
  6. my $configData;
  7. if ((not -e $configFile)) {
  8. $configData = {};
  9. DumpFile($configFile, $configData);
  10. } else {
  11. $configData = LoadFile($configFile);
  12. }
  13. sub addConfig {
  14. }
  15. sub changeConfig {
  16. }
  17. sub mount {
  18. }
  19. sub unmount {
  20. }
  21. sub list {
  22. foreach my $name (keys %{$configData}) {
  23. print " - ${name}\n";
  24. }
  25. }
  26. sub usage {
  27. print "sshfs-helper [ add | list | edit name | mount name | unmount name | help ]\n";
  28. }
  29. sub help {
  30. usage();
  31. print <<EOF;
  32. EOF
  33. exit 1;
  34. }
  35. if (@ARGV == 0) {
  36. usage();
  37. exit 1;
  38. }
  39. my $command = shift @ARGV;
  40. my @arguments = @ARGV;
  41. if ($command eq "add") {
  42. addConfig(@arguments);
  43. } elsif ($command eq "list") {
  44. list();
  45. } elsif ($command eq "edit") {
  46. } elsif ($command eq "mount") {
  47. } elsif ($command eq "unmount") {
  48. } elsif ($command eq "help") {
  49. } else {
  50. usage();
  51. exit 1;
  52. }
  53. DumpFile($configFile, $configData);