mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
some new commands; lfs wip
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
function printUsage() {
|
||||
println(`Usage: gzip [-c] [-d] file
|
||||
println(`Compresses or de-compresses (with -D flag) a file in-place, or to stdout if -C flag is set.
|
||||
Usage: gzip [-c] [-d] file
|
||||
To compress a file, replacing it with a gzipped compressed version:
|
||||
gzip file.ext
|
||||
To decompress a file, replacing it with the original uncompressed version:
|
||||
gzip -d file.ext.gz
|
||||
To compress a file specifying the output filename:
|
||||
gzip -c file.ext > compressed_file.ext.gz
|
||||
gzip -c file.ext | writeto compressed_file.ext.gz
|
||||
To decompress a gzipped file specifying the output filename:
|
||||
gzip -c -d file.ext.gz > uncompressed_file.ext`)
|
||||
gzip -c -d file.ext.gz | writeto uncompressed_file.ext`)
|
||||
}
|
||||
|
||||
if (exec_args[1] === undefined) {
|
||||
|
||||
21
assets/disk0/tvdos/bin/lfs.js
Normal file
21
assets/disk0/tvdos/bin/lfs.js
Normal file
@@ -0,0 +1,21 @@
|
||||
function printUsage() {
|
||||
println(`Collects files under a directory into a single archive.
|
||||
Usage: lfs [-c/-x/-t] dest.lfs path\\to\\source
|
||||
To collect a directory into myarchive.lfs:
|
||||
lfs -c myarchive.lfs path\\to\\directory
|
||||
To extract an archive to path\\to\\my\\files:
|
||||
lfs -x myarchive.lfs \\path\\to\\my\\files
|
||||
To list the collected files:
|
||||
lfs -t`)
|
||||
}
|
||||
|
||||
const option = exec_args[1]
|
||||
const lfsPath = exec_args[2]
|
||||
const dirPath = exec_args[3]
|
||||
|
||||
|
||||
if (option === undefined || lfsPath === undefined || option.toUpperCase() != "-T" && dirPath === undefined) {
|
||||
printUsage()
|
||||
return 0
|
||||
}
|
||||
|
||||
13
assets/disk0/tvdos/bin/tee.js
Normal file
13
assets/disk0/tvdos/bin/tee.js
Normal file
@@ -0,0 +1,13 @@
|
||||
if (exec_args[1] === undefined) {
|
||||
println("Usage: after a pipe,\n tee filename")
|
||||
return 0
|
||||
}
|
||||
|
||||
if (!_G.shell.hasPipe()) {
|
||||
println("Pipe not opened")
|
||||
return 1
|
||||
}
|
||||
|
||||
let txt = _G.shell.getPipe()
|
||||
files.open(_G.shell.resolvePathInput(exec_args[1]).full).swrite(txt)
|
||||
print(txt)
|
||||
11
assets/disk0/tvdos/bin/writeto.js
Normal file
11
assets/disk0/tvdos/bin/writeto.js
Normal file
@@ -0,0 +1,11 @@
|
||||
if (exec_args[1] === undefined) {
|
||||
println("Usage: after a pipe,\n writeto filename")
|
||||
return 0
|
||||
}
|
||||
|
||||
if (!_G.shell.hasPipe()) {
|
||||
println("Pipe not opened")
|
||||
return 1
|
||||
}
|
||||
|
||||
files.open(_G.shell.resolvePathInput(exec_args[1]).full).swrite(_G.shell.getPipe())
|
||||
Reference in New Issue
Block a user