Manages module versions.
Executed in the module directory, this command is used to obtain or upgrade a version number and write the data back to oh-package.json5.
If you run the ohpm version command without any parameter, the version number of the current module is displayed in the standard output.
newversion must be set to a valid semantic version. The command overwrites the module's current version with this value and prints it to standard output.
When parameter major is used:
When parameter minor is used, the major version number is fixed, and the minor and patch version numbers are changed according to the following rules:
When parameter patch is used, the major and minor version numbers are fixed, and the patch version number is changed according to the following rules:
You can append the --prefix <string> parameter to the ohpm version command to specify the root directory of the package. The root directory must contain the oh-package.json5 file.
You can append the --pf <string> or --parameterFile <string> parameter to the ohpm version command to specify the path of the parameterization configuration file. Before running this command, ensure that parameterFile is configured in the project-level oh-package.json5 file.
In ohpm 6.0.2.636 and later versions, you can append the --log_level <string> parameter to the ohpm version command to specify the log level (info, debug, warn, or error) for execution of the current command. If this parameter is not set, the log_level setting in the .ohpmrc file is applied.
In ohpm 6.0.2.636 and later versions, you can append the --debug parameter to the command to set the log level to debug for execution of the current command. This configuration takes effect only on the current command line and does not alter the log level configured in the .ohpmrc file. If this parameter is not set, the log_level setting in the .ohpmrc file is applied.
For the entry module, the version number is 1.0.0, run the following command in the root directory of the current module:
ohpm version
Below is an output example:

Run the following command:
ohpm version 1.0.1-beta.1
Below is an output example:

Run the following command:
ohpm version major
Below is an output example:
