mirror of
https://github.com/ksherlock/profuse.git
synced 2025-01-10 23:29:42 +00:00
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@308 aa027e90-d47c-11dd-86d7-074df07e0730
This commit is contained in:
parent
1b0f3ba4f5
commit
911ca8637d
31
apfm.cpp
31
apfm.cpp
@ -400,7 +400,7 @@ int action_cat(unsigned argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (argc < 1)
|
if (argc < 1)
|
||||||
{
|
{
|
||||||
commandUsage(kCommandCAT);
|
commandUsage(kCommandCAT);
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < argc; ++i)
|
for (unsigned i = 0; i < argc; ++i)
|
||||||
@ -468,7 +468,7 @@ int action_mv(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
{
|
{
|
||||||
commandUsage(kCommandMV);
|
commandUsage(kCommandMV);
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *source = argv[0];
|
const char *source = argv[0];
|
||||||
@ -477,7 +477,7 @@ int action_mv(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (!volume->fileByName(source))
|
if (!volume->fileByName(source))
|
||||||
{
|
{
|
||||||
std::fprintf(stderr, "apfm mv: %s: no such file.\n", source);
|
std::fprintf(stderr, "apfm mv: %s: no such file.\n", source);
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if -i and destination file exists, confirm overwritting it.
|
// if -i and destination file exists, confirm overwritting it.
|
||||||
@ -487,7 +487,7 @@ int action_mv(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
std::fprintf(stderr, "Not overwritten.\n");
|
std::fprintf(stderr, "Not overwritten.\n");
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ int action_cp(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
{
|
{
|
||||||
commandUsage(kCommandCP);
|
commandUsage(kCommandCP);
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *source = argv[0];
|
const char *source = argv[0];
|
||||||
@ -537,7 +537,7 @@ int action_cp(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (!volume->fileByName(source))
|
if (!volume->fileByName(source))
|
||||||
{
|
{
|
||||||
std::fprintf(stderr, "apfm cp: %s: no such file.\n", source);
|
std::fprintf(stderr, "apfm cp: %s: no such file.\n", source);
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if -i and destination file exists, confirm overwritting it.
|
// if -i and destination file exists, confirm overwritting it.
|
||||||
@ -547,7 +547,7 @@ int action_cp(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
std::fprintf(stderr, "Not overwritten.\n");
|
std::fprintf(stderr, "Not overwritten.\n");
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -650,7 +650,7 @@ int action_krunch(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (iFlag)
|
if (iFlag)
|
||||||
{
|
{
|
||||||
bool ok = yes_or_no("Are you sure you want to krunch this volume?");
|
bool ok = yes_or_no("Are you sure you want to krunch this volume?");
|
||||||
if (!ok) return 1;
|
if (!ok) return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
volume->krunch();
|
volume->krunch();
|
||||||
@ -683,7 +683,7 @@ int action_get(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
case 'h':
|
case 'h':
|
||||||
default:
|
default:
|
||||||
commandUsage(kCommandGET);
|
commandUsage(kCommandGET);
|
||||||
return c == 'h' ? 0 : 1;
|
return c == 'h' ? 0 : -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -704,7 +704,7 @@ int action_get(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
commandUsage(kCommandGET);
|
commandUsage(kCommandGET);
|
||||||
return 1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -714,7 +714,7 @@ int action_get(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (!entry)
|
if (!entry)
|
||||||
{
|
{
|
||||||
std::fprintf(stderr, "apfm get: %s: no such file.\n", infile);
|
std::fprintf(stderr, "apfm get: %s: no such file.\n", infile);
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -728,7 +728,7 @@ int action_get(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
std::fprintf(stderr, "Not overwritten.\n");
|
std::fprintf(stderr, "Not overwritten.\n");
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -805,6 +805,7 @@ int action_put(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
default:
|
default:
|
||||||
commandUsage(kCommandPUT);
|
commandUsage(kCommandPUT);
|
||||||
return c == 'h' ? 0 : -1;
|
return c == 'h' ? 0 : -1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -826,6 +827,10 @@ int action_put(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
infile = argv[0];
|
infile = argv[0];
|
||||||
outfile = argv[1];
|
outfile = argv[1];
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
commandUsage(kCommandPUT);
|
||||||
|
return -1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -848,7 +853,7 @@ int action_put(int argc, char **argv, Pascal::VolumeEntry *volume)
|
|||||||
if (::stat(infile, &st) != 0)
|
if (::stat(infile, &st) != 0)
|
||||||
{
|
{
|
||||||
std::fprintf(stderr, "apfm put: %s: no such file.\n", infile);
|
std::fprintf(stderr, "apfm put: %s: no such file.\n", infile);
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!S_ISREG(st.st_mode))
|
if (!S_ISREG(st.st_mode))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user