vcp

Package: WA2L/WinTools 1.2.08
Section: General Commands (1)
Updated: 18 March 2022
Index Return to Main Contents

 

NAME

vcp - create a copy of a file with a new version number

 

SYNOPSIS

WA2LWinTools/bin/vcp [ -h | -i | -u | -V ]

vcp file...

 

AVAILABILITY

WA2L/WinTools

 

DESCRIPTION

create a copy of the file by incrementing the version number (if the destination file does not already exist).

vcp scans the file name for a version number pattern and increments the version found by 1:

User Manual V1.0.docx => User Manual V1.1.docx

When a file contains multiple matches to recognized version numbers, the last one is the one handled as version and is incremented:

Ubuntu V14.1 Cheatsheet-V1.0.3.tex => Ubuntu V14.1 Cheatsheet-V1.0.4.tex

When a file name ends with a timestamp (before the suffix) as created using the sav(1) or savnow(1) commands, the timestamp is removed and the version number is incremented:

Capacity Calculation V2.5.03.20141225.xlsx => Capacity Calculation V2.5.04.xlsx

Finally, when a file name does not contain a recognized version number pattern, the new file is created with the default first version as defined in the VERSIONSTART=-V0.1 setting in the configuration file vcp.cfg(4). The VERSIONSTART setting accepts any value, but a setting should be chosen that can be computed by vcp later:

My Mansion Plan.dxf => My Mansion Plan-V0.1.dxf

vcp can handle the following version number formats (VERSION):

  VERSION ::= PREFIX, DIGIT, { DIGIT }, { ".", DIGIT, { DIGIT } } 
              | "(", DIGIT, { DIGIT }, ")" ;

  PREFIX  ::= " " | "_" | "-" | "v" | "V" | "#" ;

  DIGIT   ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;

In other words:

vcp can handle version numbers starting with any of the PREFIXes (SPACE,_,-,v,V,#) optionally having dots (.) to reflect major, minor, patch etc. versions or numbers without dots enclosed in round brackets.

Examples of resolved VERSION numbers based on the EBNF definition above:

  V12.34.56.789
  
  V12.3.45.67
  V12.3.45.6
  V12.3.45
  
  V12.3.4.56
  V12.3.4.5
  V12.3.4
  
  V12.34
  V12.3
  V1.2
  
  V123
  V12
  V1
  
  (123)
  (12)
  (1)

 

OPTIONS

-h
usage message.

-i
install the vcp command as menu point to the 'Send To' context menu in 'Windows Explorer'.

-u
uninstall the vcp shortcut from the 'Send To' context menu in 'Windows Explorer'.

-V
print program version.

file...
list of files of which to create a copy. When installed in the 'Send To' menu the selected file(s) in 'Windows Explorer' are passed as a list of files to the vcp command.

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

4
usage message displayed.

5
version message displayed.

 

FILES

etc/vcp.cfg
config file for vcp.

file
file to create a new version copy.

file.meta
if a file.meta file exists for a given file also the meta file is copied to a new version.

.meta/file.meta
if a file.meta file exists for a given file also the meta-file is copied to a new version.

 

EXAMPLES

1) Some examples of source file names and created copies:
manual.docx          =>  manual v1.docx
manual.docx          =>  manual v1.0.docx
manual.docx          =>  manual v1.0.0.docx

manual_v10.docx      =>  manual_v11.docx
manual_v100.docx     =>  manual_v101.docx
manual_v1.0.docx     =>  manual_v1.1.docx
manual_v10.0.docx    =>  manual_v10.1.docx
manual_v1.00.docx    =>  manual_v1.01.docx
manual_v1.0.0.docx   =>  manual_v1.0.1.docx
manual_v1.0.00.docx  =>  manual_v1.0.01.docx

manual_V10.docx      =>  manual_V11.docx
manual_V100.docx     =>  manual_V101.docx

manual_V1.0.00.docx  =>  manual_V1.0.01.docx

manual v10.docx      =>  manual v11.docx
manual v100.docx     =>  manual v101.docx

manual v1.0.00.docx  =>  manual v1.0.01.docx

manual V10.docx      =>  manual V11.docx
manual V100.docx     =>  manual V101.docx

manual V1.0.00.docx  =>  manual V1.0.01.docx

 

SEE ALSO

wintoolsintro(1), metadata(1), sav(1), savnow(1), config(1m), vcp.cfg(4), https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form, https://en.wikipedia.org/wiki/Software_versioning#Sequence-based_identifiers

 

NOTES

-

 

BUGS

-

 

AUTHOR

vcp was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2022 Christian Walther

This is free software; see WA2LWinTools/man/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:33:12 GMT, September 14, 2024